Baltzer Journals
October 1, 1996
Some Algorithms for Discrete Time Queues with Finite Capacity Vinod SHARMA ; and NANDYALA D. Gangadhar 1
2
INRS-Telecommunications, University du Quebec, Quebec H3E 1H6, Canada. Department of Electrical Engineering, Indian Institute of Science, Bangalore 560 012, India. E-mail:
[email protected],
[email protected] 1
2
We consider a discrete time queue with nite capacity and i.i.d. and Markov modulated arrivals. Ecient algorithms are developed to calculate the moments and the distributions of the rst time to over ow and the regeneration length. Results are extended to the multiserver queue. Some illustrative numerical examples are provided. Keywords: Finite capacity queue, discrete time queue, algorithms, over ow time, regeneration cycle length, probability of over ow, Markov modulated arrivals.
1 Introduction Although queues have traditionally been studied in continuous time (Cohen [9], Asmussen [1], Prabhu [15]), due to the arrival of the digital technology and in particular of the ATM based networks, discrete time queues have become increasingly important (see Bruneel [4], Bruneel and Kim [5] for recent surveys and Chu and Konheim [7], Kobayashi and Konheim [12], and COST report [16] for various applications). In the ATM networks, not only a switch (node) is driven by a clock, but the messages are also split into equal sized \cells" which are transmitted on the output lines in a synchronised way. Also, the current switch architectures favour output queueing (COST report [16]). This makes each output link of a switch a discrete time queue that we study in this paper. Further, an ATM network is designed to support packetised voice and video which can tolerate very little delay and delay jitter. There may be real time trac also which requires small delays in the network. Thus in ATM networks, to allow sharing of the channels for ecient utilisation and small delays by various users, small buers at dierent switches On leave from the Department of Electrical Engineering, Indian Institute of Science, Bangalore 560 012, INDIA.
SHARMA and Gangadhar / Algorithms for Finite Discrete Queues
2
are being advocated. This makes the approximation by an in nite capacity queue highly erroneous. Thus, one needs to incorporate the nite buer constraint in the queueing model itself. But then, in contrast to the in nite capacity queue, closed form expressions for various quantities of interest (even for the i.i.d. trac model) are not available. In this paper we develop algorithms for a discrete time nite buer queue. We consider a discrete queue with a nite buer size and with one or more servers. The service times are of one slot length. The arrival process could be i.i.d. or modulated by a nite state Markov chain. For a buer length of size M , we obtain algorithms for calculating the mean and the higher moments of the busy period (M ), moments of the rst time to over ow Ti(M ) , and p(iM ) , the probability of over ow in a busy period, where i is the initial number in the system. For sometime it is known that the asymptotics of these quantities, as M ! 1, are related (Sharma and Gangadhar [18]). However, a surprising result of this work is that even the above algorithms which compute these quantities exactly for nite M are related and have similar structure. An advantage of our algorithms is that if we know these quantities for buer lengths 0; : : : ; M , then calculating for M + 1 does not require much eort. This is particularly useful in the design stage because then one can nd the minimum buer length required to meet certain performance requirements. This can also be useful if one is interested in observing the behaviour of these parameters as Mi changes. In another study, h (M ) we will obtain asymptotic behaviour of IE (T0 ) , IE [( (M )) ], and p(0M ) as M tends to in nity. We elaborate on the theoretical and practical relevance of the results of this paper. The busy periods (M ) (rather, the regeneration lengths) are of fundamental importance in queueing theory and have been studied in all works on queueing. Its mean IE [ (M )] is required in the important formulae of calculating the stationary distributions (see, e.g.,Asmussen [1, p.126]), while the second moment is required in the asymptotic variance ([1, p.137]). Futhermore, moments of regeneration lengths are involved in obtaining various rates of convergence and bounds on the {mixing coecients (Sharma [17]). We also obtain moments of i (M ), the rst time the queue becomes empty when the initial queue length is i. In addition to the moments of (M ), these provide the practically useful quantity { the amount of time it takes for the eect of congestion (if i is large) to disappear. Its moments are also useful in obtaining various rates of convergence in the limit theorems. The next quantity studied, T0(M ) , provides the rst time an over ow occurs if the queue starts empty (or, with an initial queue length i; then we study Ti(M ) , as explained in the next section). For many practical systems, Ti(M ) , i 0, is actually a more useful quantity than the stationary probability of loss. In fact, for voice trac, Ti(M ) , along with the fact that the losses occur in clusters provides better information (than the stationary probability of loss) to judge the quality of
SHARMA and Gangadhar / Algorithms for Finite Discrete Queues
3
voice received from the queue (see Cidon et.al. [8] and, in particular, Sharma and Gangadhar [18] for much more structure of the loss process). Finally we will study p(0M ) , the probability that the queue length exceeds M in a regeneration cycle, which is relevant in obtaining the tail probabilities of the stationary distribution and also the asymptotics of T0(M ) (Sharma and Gangadhar [18]). Now we describe the related literature. Probability of over ow is usually studied under stationarity (see e.g., Takine et.al. [19], Cidon et.al. [8], COST report [16], for discrete queues and Bisdikian et.al. [3], Tijms [20], and Kofmann et.al. [13] for continuous time queues). Algorithms for the busy period and the rst passage times of the queue length for a nite buer discrete time queue with geometrically distributed interarrival and service times are given in Chaudhary and Zhao [6]. Their assumptions, methods (Laplace transform techniques), and the algorithms are entirely dierent from ours. The quantity p(0M ) considered above is much studied in continuous time because of its relevance to T0(M ) and the tails of the stationary probabilities. For examples and other references see Glasserman and Kou [11], Asmussen and Perry [2], and Sharma and Gangadhar [18]. But we are not aware of any algorithms to calculate p(iM ) . Also, a multiserver nite buer queue which has some essential dierences from single server queue, does not appear to have been studied till now. The rest of the paper is organised as follows. In Section 2 we consider the i.i.d. case. The algorithms are rst developed for the single server queue and then extended to the multiserver queue. In Section 3 we develop the algorithms for Markov modulated trac.
2 Queues with I.I.D. Trac We consider a single server queue in discrete time with a nite buer size M . The time axis is divided into slots of equal length (taken as one unit) with slot k being the time segment [k; k + 1). Let Xk packets arrive in slot k which are assumed to arrive just after time k. These packets are eligible for transmission from time k + 1 onward. The packets wait in the buer before transmission. Any packet being transmitted in a slot is stored in a separate memory. The number of packets waiting for transmission at time k is denoted by Wk . Then if (Wk ? 1)+ + Xk exceeds M , the excess packets are lost. Thus fWk g evolves as
Wk+1 = minf(Wk ? 1)+ + Xk ; M g:
(1)
In this section, we assume that fXk g are i.i.d. Next section will generalise the results to the Markov modulated case. Also, towards the end of this section we will generalise our results to the case when the number of servers is S; S 1.
SHARMA and Gangadhar / Algorithms for Finite Discrete Queues
4
If IP (X1 = 0) > 0 and IP (X1 1) < 1, then fWk g is a nite state, irreducible, aperiodic Markov chain. If M = 1 and IE [X1 ] < 1, then the chain is ergodic and closed form expressions for the stationary mean and higher moments of Wk and busy period under appropriate additional conditions are available (see, for instance, Bruneel and Kim [5] and Gangadhar [10]). For M < 1, these expressions can provide upper bounds but closed form expressions are not available. Then one can solve M X P = and (i) = 1; i=0
where P is the transition probability matrix of fWk g. From this one can obtain the stationary moments of Wk and waiting time. Now let W0 = 0 and let be the rst time after 0 when Wk again becomes zero. Observing that whenever Wk = 0, there is no transmission in the kth slot, one can show that IE [ ] = 1=(0):
(2)
Similar expressions for IE [ ], > 1 a positive integer, do not seem to be available. Also, for the i.i.d. case, can be considered as the regeneration length for fWk g. The moments of regeneration lengths are of considerable interest. For the multiserver and Markov modulated generalisations, (2) does not provide the mean regeneration length. We obtain algorithms to compute the moments of the regeneration length for all these cases. It is also of interest to know when Wk = 0 for the rst time after k = 0, if W0 = i, i 0. We will call it the rst busy period, and denote it by i (M ). In Subsection 2:1, we develop the algorithms for the moments and distributions of i (M ) while those of Ti(M ) and p(iM ) are considered in Subsection 2:2. In Subsection 2:3, we derive an alternate set of algorithms. In Subsection 2:4, algorithms for a multiserver queue are developed. 2.1 Regeneration Lengths Let i (M ) denote the rst time, after zero, Wk = 0, if W0 = i M (then 0 (M ) = (M )). By conditioning on the number of arrivals in the 0th slot,
IE [ (M )] = IP (X0 = 0) + = 1+
MX ?1 k=1
MX ?1 k=1
(1 + IE [k (M )])IP (X0 = k)
+ IP (X0 M )(1 + IE [M (M )]) IP (X0 = k)IE [k (M )] + IP (X0 M )IE [M (M )]: (3)
Now we show the following result which will be repeatedly used in this paper:
SHARMA and Gangadhar / Algorithms for Finite Discrete Queues For 1 k M ,
k (M ) =
k X l=1
(M ? l + 1);
5
(4)
where (n); n = M ? k + 1; : : : ; M can be taken to be independent. Consider the queue with W0 = k. In the zeroth slot, one of these k packets departs while X0 new packets arrive. From slot one onward we serve only the packets which arrive from the zeroth slot onward till all such packets are served. Now, for these packets, only M ? (k ? 1) buers are available (since k ? 1 buers are occupied by packets which were in the system at time k = 0). Thus the time required to serve all the packets arriving from slot 0 onward is (M ? (k ? 1)). In the slot after that, one of the initial k ? 1 packets is served and from then on only the new packets arriving from that slot onwards will be served. This procedure is repeated till all the initial k packets are also exhausted, providing us (4). Using (4), we can rewrite (3) as a set of recursive equations: IE [ (1)] = 1 = IP (X0 = 0); [ (1)] ; IE [ (2)] = 1 + IPIP(X(0X =2)IE 0) 0
"
1
MX ?1
IE [ (M )] = IP (X = 0) 1 + IE [ (M ? k + 1)]IP (M ? 1 X0 k) 0 k=2 # + IP (X0 M )
M X l=2
IE [ (M ? l + 1)] ; M > 2: (5)
We will obtain similar equations for the higher moments and moment generating function of (M ). Considering (3) we can obtain another algorithm for calculating IE [i (M )]: For a xed M , in addition to (3), we can also write IE [1 (M )] = IE [0 (M )] P ?i IE [i (M )] = 1 + M k=0 IP (X = k)IE [i?1+k (M )]
(6)
+ IP (X M ? i + 1)IE [M (M )]; M i 2: Thus we obtain a system of M + 1 equations with equal number of unknowns, IE [i (M )], i = 0; 1; : : : ; M . De ning ai =IP (X0 = i), and a~i = IP (X0 i), this
SHARMA and Gangadhar / Algorithms for Finite Discrete Queues
6
set is of the form A? = b, where 1 ?1 0 6 0 1?a ? a2 1 6 6 A = 666 0 ? a0 1 ? a1 6 4 0 0 0 0 0 0 2
0 0 0 ?aM ? ?aM ? ?aeM ?aM ? ?aM ? ?aeM ? ?a 1 ? a ?ae a 0 ?a 2
1
3
2
0
1
0
1
2
3 7 7 7 7 7 7 7 5
;
0
? = (IE [ (M )]; : : : ; IE [M (M )])T , and b = (0; 1; : : : ; 1)T . When a < 1, the matrix A is nonsingular and hence we will obtain a unique solution. 0
1
Algorithms (5) and (6) could be used at dierent times. For example, if one only wants IE [ (M )] and would like to compare this value for dierent values of M , (5) should be preferred. On the other hand, if we have a system of buer length M then (6) may be preferred because IE [i (M )] are also of practical interest. Now we obtain algorithms corresponding to (5) and (6) for IE ( (M ))2 . The extension to IE [( (M ))n ] for n a positive integer will be obvious. To obtain an algorithm corresponding to (5), we again use (4). Then, by independence, we have, for 1 k M ,
k X
IE (k (M ))2 =
l=1
+
IE ( (M ? l + 1))2
k X
k X
l=1 n=1;n6=l
IE [ (M ? l + 1)]IE [ (M ? n + 1)]:
(7)
The equation corresponding to (3) now becomes
IE ( (M ))2 = 2IE [ (M )] ? 1 +
MX ?1 k=1
IP (X0 = k)IE (k (M ))2 + aeM IE (M (M ))2 : (8)
Using (7) in this equation and interchanging the order of the summations, we obtain the following set of recursive equations for computing IE ( (M ))2 : IE ( (1))2 = IP (X1 = 0) [2IE [ (1)] ? 1] ; 0 1 2 IE ( (2)) = IP (X = 0) 2IE [ (2)] ? 1 + IP (X0 2)IE ( (1))2 0 + 2IP (X0 2)IE [ (1)]IE [ (2)]] ;
SHARMA and Gangadhar / Algorithms for Finite Discrete Queues
7
IE ( (M ))2 " 1 = IP (X = 0) 2IE [ (M )] ? 1 + IP (X0 M )IE ( (1))2 0 + +
MX ?1
IP (X0 l)IE ( (M ? l + 1))2
l=2 MX ?1 X k
k X
IP (X0 = k)IE [ (M ? l + 1)]IE [ (M ? n + 1)]
k=1 l=1 n=1;n6=l M X M X
+ IP (X0 M )
#
l=1 n=1;n6=l
IE [ (M ? l + 1)]IE [ (M ? n + 1)] :
(9)
Corresponding to (6), we can get the following set of equations to solve for IE (i (M ))2 :
IE (1 (M ))2 = IE (0 (M ))2
P ?1 2 = 2IE [0 (M )] ? 1 + M k=1 IP (X = k)IE (k (M ))
+ IP (X > M ? 1)IE (M (M ))2 ;
(10)
P ?i 2 IE (i (M ))2 = 2IE [i (M )] ? 1 + M k=0 IP (X = k)IE (i?1+k (M ))
+ IP (X > M ? i)IE (M (M ))2 ; M i 2: This can be written as A?2 = b1 ; where ?2 = IE (0 (M ))2 ; : : : ; IE (M (M ))2 T and b1 = (0; 2IE [1 (M )] ? 1; : : : ; IE [M (M )] ? 1)T . To solve this system of equations, we rst have to obtain IE [i (M )] from (6). Once we have IE [ (M )], we can also calculate the stationary probability of loss which equals (see Appendix) 1 ? IE 1[X ] 1 ? IE [1(M )] ?
Using Little's law, if IE [W ] is available, we can also calculate the mean waiting time of the packets that enter the queue.
SHARMA and Gangadhar / Algorithms for Finite Discrete Queues
8
For obtaining the distributions of i (M ), we proceed as follows: We can write IP (i (M ) = 1) = IP (X0 = 0) for i = 0 or i = 1 = 0 for i 2; PM ?(i?1)+
IP (i (M ) = n) =
j =1
IP (X0 = j )IP (i?1)+ +j (M ) = n ? 1
(11)
+ IP (X0 M ? (i ? 1)+ )IP (M (M ) = n ? 1); n 2; i 0: It is possible to solve this system of equations but unlike the case of IE [(i (M ))n ], now the number of equations to solve increases with n. A similar algorithm can (M ) be provided for Ti(M ) . Actually for M large, the distribution can be aph iof Ti (M ) proximated by an exponential distribution with mean IE Ti which has already been calculated (Sharma and Gangadhar [18]). For 0 (M ), we can combine these equations with (4) to obtain moment generating functions eciently as follows: h i IE z 0 (1) =
=
1 X n=0
1 X
n=0
IP (0 (1) = n)z n
a0 (1 ? a0 )n?1 zn
= 1 ?a0a 1 ? (11? a )z ; 0 0
a0 6= 1. For M > 1, from (11), h i IE z 0 (M ) = z IP (X0 = 0) + +
1 X n=2
1 X
n=2
zn
MX ?1 i=1
IP (X0 = i)IP (i (M ) = n ? 1)
znIP (X0 M )IP (M (M ) = n ? 1)
= z IP (X0 = 0) + z
MX ?1 i=1
+ z IP (X0 M ) = z IP (X0 = 0) + z
IP (X0 = i)
1 X
n=2 MX ?1 i=1
1 X n=2
zn?1 IP (i(M ) = n ? 1)
zn?1 IP (M (M ) = n ? 1)
h i h i IP (X0 = i)IE z i (M ) + z IP (X0 M )IE z M (M ) :
SHARMA and Gangadhar / Algorithms for Finite Discrete Queues From (4) we get
9
i
h i i Y h IE z i (M ) = IE z 0 (M ?l+1)
l=1
h i and hence we obtain a recursive algorithm for calculating IE z 0 (M ) .
2.2 Ti(M ) and p(iM ) In this section we derive algorithms to compute the moments of the rst time to over ow and the probability of an over ow in a regeneration cycle. Let Ti(M ) denote the rst time, after zero, (Wk ? 1)+ +Xk exceeds M (hence over ow occurs), when W0 = i M . Let p(iM ) denote the probability that in the rst busy period over ow occurs, with W0 = i M . Conditioning on the number of arrivals in the 0th slot, we get h
IE T0(M ) h
IE Ti
h i h i P (M ) (M ) a IE T = 1+ M = IE T i i=0 1 i
i
M )i
PM ?i+1
= 1 + j =0
(
h
i
M)
aj IE Ti?1+j ; 2 i M: (
(12)
Equations (12) are in the form RT = b where 2
?1 0 6 ?a 1 ? a ?a 6 R = 666 0 ?a 1 ? a 4 1
0
1
2
0
0
h
i
h
0
T = IE T M ; : : : ; IE TMM ( 0
)
(
)
iT
For p(iM ) , we obtain,
0
3
0 0 ?aM ? ?aM ?aM ? ?aM ? ?a 1 ? a 1
1
2
1
0
7 7 7 7 7 5
1
, and b = (0; 1; : : : ; 1)T .
(M ) p(0M ) = p(1M ) = aeM +1 + PM i=1 ai pi
pi M )
PM ?i+1
) aj pi?M1+ j;
= aeM ?i+2 + j =0 These equations can be written as Q = ae, where (
(
2 i M:
2
3
1 ?1 0 0 0 6 0 1?a ?a2 ?aM ?1 ?aM 777 1 6 6 Q = 66 0 ?a0 1 ? a1 ?aM ?2 ?aM ?1 77 ; 4
0
0
;
0
?a
0
1 ? a1
5
(13)
SHARMA and Gangadhar / Algorithms for Finite Discrete Queues
10
= p M ; : : : ; pMM T , and ae = (0; aeM ; : : : ; ae )T . We can check that when a > 0 and a < 1, R and Q are nonsingular and
( 0
)
(
)
+1
0
2
1
hence the above systems of equations have unique solutions. 2 Following the above procedure, the system of equations for IE Ti(M ) is :
IE T
M ) 2
( 0
h
= 2IE T
M ) i ? 1 + PM a IE i=0 i
( 0
2
Ti
M ) 2
(
= IE T
M ) 2
( 1
h i 2 P ?i+1 (M ) = 2IE Ti(M ) ? 1 + M j =0 aj IE Ti?1+j ; 2 i M (14) 2 ( M ) ; :::; This set can be written as RT(2) = b2 , where T(2) = IE T0
IE Ti(M )
2 T
i
h
h
i
IE TM(M ) , R is as in (12), and b2 = (0; 2IE T1(M ) ? 1; : : : ; 2IE TM(M ) ? 1)T . The matrices A, R, and Q have similar structure and these equations can be solved in 21 (M 2 + 3M ) multiplications. If we only want IE [0 (M )] and want to study them as functions of M , (5) provides ah moreiecienth way. i Now we provide ecient algorithms for IE Ti(M ) and IE (Ti(M ) )2 . We will reh i quire two dierent algorithms for these two quantities. To calculate IE (Ti(M ) )n , h i 0 n = 1; 2, once we have IE (Ti(M ) )n , M 0 = 1; ; Mh ? 1, iwill require O(M ) multiplications. First we describe the algorithm for IE Ti(M ) ; the algorithm for computing p(iM ) is obtained by a simple modi cation of this. (T ) In the following, AM , and BM are M ? 1 dimensional column vectors and CM is an M ? 1 dimensional row vector. By solving the equations for the case M = 2, we get h
i
h
i
h
i
IE T0(2) = IE T1(2) IE T2(2) where
(T ) = 1 ? a1 +?Ca2 ?AC2 B ; 0 1 h 2 i 2 (T ) = A2 + B2 IE T0(2) ;
A T = 1 ?1 a ; B = 1 ?a a ; C = a : ( ) 2
1
0
2
1
2
2
Now we develop equations recursive in M . Consider any M 3. Suppose that the following holds for such an M (it does for M = 3):
h
i
h
IE T2(M ?1) ; : : : ; IE TM(M??1 1)
iT
h
i
(T ) (M ?1) = AM : ?1 + BM ?1 IE T1
SHARMA and Gangadhar / Algorithms for Finite Discrete Queues
11
Then the second equation from the set RT = b gives i h i h 1 + C A(T ) IE T1(M ?1) = 1 ? a ?MC?1 MB?1 + 1 ? a ? Ca0 B IE T0(M ?1) : 1 M ?1 M ?1 1 M ?1 M ?1 Hence we obtain
h
i
h
IE T1(M ?1) ; : : : ; IE TM(M??1 1)
where
AMT
!
0
=
( )
AMT ? ( )
1
iT
h
(T ) 1 + CM ?1 AM ?1
BM = 1 ? a ? Ca B M? M?
1
0
1
!
BM ?
1
1
!
1
+ 1?a ?C B 1 M ?1 M ?1
1
i
(T ) = AM + BM IE T0(M ?1) ;
BM ?
1
; (15)
;
and
CM = (CM ? ; aM ); M 3: Now hwe exploit the fact that the last M ? 1 equations of RT = b for the case i M of IE Ti remain the same as the last M ? 1 equations (but for the new index h i 1
(
)
M ) for IE Ti(M ?1) . Hence,
h
i
h
iT
h
i
(T ) IE T2(M ) ; : : : ; IE TM(M ) = AM + BM IE T1(M ) : From the second of the equations in the set RT = b, we obtain
h
i
(T ) 1 + CM AM + a0 IE T0(M ) (M ) : IE T1 = 1 ? a1 ? CM BM The rst equation then implies
h
h
IE T
i
M ) i = IE hT (M ) i =
( 0
1
(T ) 1 + CM AM
1 ? a 0 ? a1 ? CM B M : h
i
(16)
(17)
(18)
Thus we have obtained expressions for IE Ti(M ) given the equations for M ? 1. h i For IE (Ti(M ) )2 the above technique does not apply as the right hand sides of these equations change with M . For these, we describe another algorithm. We rewrite RT(2) = b2 by shifting the rst row to the bottom as "
RM r M rM 0 1
2
#"
t
1
t2
#
"
#
= d0 ; 1
SHARMA and Gangadhar / Algorithms for Finite Discrete Queues
12
where RM is an M M matrix, r1M is (?aM ; ?aM ?1 ; ; ?a2 ; 1 ? a1 )T , and r2M is (1; ?1; 0; ; 0). Similarly, t1 , t2 , d1 are obviously de ned. The last equation h i h i of this system of equations simply says that IE (T0(M ) )2 = IE (T1(M ) )2 . From the rest of the equations we get
RM t + r M t = d 1
1
and hence
2
1
t = R?M (d ? r M t ): (19) Since the rst two components of t are the same, we thus get ? ? t = (R? M d ) ? (R?M d ) ; (RM r M ) ? (RM r M ) where (X)i denotes the ith component h of vector i X. Now from (19), we can obtain IE (T M ) = (t ) , once we have R?M , in 5M 1
1
1
1
2
1
1
2
1
1
1
1 1
1
1
( 0
1 2
1
) 2
2
1
1 1
multiplications. We now obtain an ecient algorithm to calculate R?M1 , once R?M1?1 is known. Since 2 ?a0 1 ? a1 ?a2 ?aM ?1 3 6 0 ?a0 1 ? a1 ?aM ?2 777 6 6 0 ?a0 ?aM ?3 77 ; RM = 66 0 . 6 7 ... .. 4 5 0 0 0 ?a0 it is a triangular Toeplitz matrix. Its inverse is also a triangular Toeplitz matrix (see Yen [21]), 2 3
d0 d1 d2 dM ?1 0 d0 d1 dM ?2 ? 1 4 RM = 0 0 d0 dM ?3 6 6 6 6 6 6 4
where
.. ... . 0 0 0
d0 = ? a1 ; 0
d0
!
7 7 7 7 7 7 5
nX ?2 dn = a1 (1 ? a1 )dn?1 ? an?k dk ; 1 n M ? 1: 0 k=0
(20)
Since RM and RM ?1 have the same rst M ? 1 components, dn is same for R?M1 and R?M1?1, for n = 0; ; M ? 2, and thus we only need to calculate dM ?1
SHARMA and Gangadhar / Algorithms for Finite Discrete Queues
13
which requires M multiplications. Thus, h h 6M multiplicai our algorithm requires i (M ) 2 ? 1 ? 1 tions to calculate RM and IE (T0 ) once we have RM ?1 , IE (T0(M ?1) )2 , and h i h i IE Ti(M ) . We can, of course, use this algorithm for calculating IE Ti(M ) also; but the complexity will be of the same order as for the algorithm given above. The procedure for computing the distributions, presented in Section 2.1, can be seen to be easily adaptable for nding the distributions of Ti(M ) . 2.3 Another Set of Algorithms It is instructive to compare the algorithms presented in the previous subsections with another set of algorithms. Instead of (3) we now write IE [i (M )] for i > 0 as
IE [i(M )] =
1 X
n=0
IP (i (M ) n):
(21)
De ne Qb as a matrix obtained by deleting the zeroth row and column from P. Then we obtain 1 X M (n) X M X IE [i (M )] = Qb ij = Gij (22)
n=1 j =1
?1
j =1
exists whenever P is irreducible. To obtain IE [ (M )] we where G = I ? Qb now use (3). One can similarly show that for i > 0,
IE (i (M ))2 = 2
M X
j =1
Gij ? 2
M X
j =1
Gij
(23)
and then obtain IE ( (M ))2 as above. Similarly one can develop algorithms for IE [(i (M ))n ]. It is easy to show that these algorithms h areimore expensive than those developed earlier although for the case of IE Ti(M ) we can, after some manipulation, obtain RT = b. It is interesting that we can obtain p(iM ) also from algorithms of the type of (22) using Pitman [14, p.85]. From fWk g de ne a f g as W f = W if there is no over ow in slot (k ? 1), otherwise Markov chain fW k k k f f g, obtain Q e by W k = M + 1. From the transition probability matrix of fW k h i (M ) n deleting the last row and column. Then IE (Ti ) is obtained from (22){(23) if e = (I?Q e )?1 and let G be obtained from G e by replacing we replace Qb by Qe . Let G 0 all columns except the zeroth by zeroes. Let N be a r.v. with distribution IP (N = n) = p(0M ) (1 ? p(0M ) )n : Then from Pitman [14], M X IE [N ] = 1 ? 1 = (G )
p(0M )
j =1
j
0 0
SHARMA and Gangadhar / Algorithms for Finite Discrete Queues
14
e is known, then this is a less expensive way to calculate p(M ) than (13). If G 0
2.4 Multiserver Queue Now we extend the algorithms to the multiserver queue with S; S 1 servers. The process fWk g evolves as Wk+1 = minf(Wk ? S )+ + Xk ; M g: We consider the regeneration epochs as the instants when Wk S . An equation corresponding to (4) does not hold for S > 1. If we take the regeneration epochs as instants when Wk < S , then we would get the inequalities k (M ) = 0 (M ); for k S
k (M )
k X
j =1
(minfM ; M ? k + jS g):
For S large this bound could be quite weak and also does not provide algorithms for computing IE [ (M )]. Thus we retain the earlier de nition of the regeneration epochs. The equations (6) get modi ed to P ?1 IE [i (M )] = 1 + M j =1 IP (X = j )IE [j (M )] + IP (X M ))IE [M (M )]; 0 i S; P ?i+S ?1 = 1+ M IP (X = j )IE [i?S +j (M )] j =0
(24)
+ IP (X M ? i + S ))IE [M (M )]; S < i M One can similarly develop algorithms corresponding to (10). Unlike for the single server queue, from IE [ (M )] now we can only get bounds on the stationary probability of packet loss (Gangadhar [10]): S 1 S 1 ? IE [X ] Stat. Prob. of Loss 1 ? IE [X ] 1 ? IE [ (M )] and using Little's law, these can provide upper and lower bounds on the mean waiting times of the packets entering the queue. h i (M ) The equations for IE Ti become h
IE Ti(M )
i
h i P (M ) = 1+ M ; 0iS j =0 IP (X = j )IE Tj PM ?(i?S )
= 1 + j =0
IP (X = j )IE
h
i Ti?MS)+j ; (
S 0; 0 j k j W0 = n; Y0 = i):
h
i
(M ) The quantities IE Tn;i satisfy the following equations (cf. (12)):
h i h i P PN ?1 ij h (M ) i (M ) IE T0(;iM ) = 1 + M IE T C = IE T k=0 j =0 k 1;i k;j
IE
h
i Tn;iM ) (
PM ?n+1 PN ?1
= 1 + k=0
j =0
h i ) Ckij IE Tn(M?1+ k;j ;
2 n M:
(26)
(m) Similarly, fpn;i g satis es
PN ?1 ij (M ) (M ) p(0M;i ) = aeM +1;i + PM k=1 j =0 Ck pk;j = p1;i
pn;iM )
PM ?n+1 PN ?1
) Ckij p(nM?1+ k;j ;
(27)
2 n M; = aeM ?n+2;i + k=0 j =0 where aem;i = IP (X0 m j Y0 h= i); ii 0. (M ) Now we see that the fIE Tn;i g and fp(n;iM ) g satisfy RT = B and Q = A (
SHARMA and Gangadhar / Algorithms for Finite Discrete Queues with
16
I ?I 0 0 0 0 3 6 ?b I ? b ?b ?bM ? ?bM ? ?bM 777 6 6 R = 66 0 ?b I ? b ?bM ? ?bM ? ?bM ? 77 ; 4 5 0 0 0 0 ?b I ? b 2 I ?I 0 0 0 0 3 6 0 I?b ?b ?bM ? ?bM ? ?bM 777 6 6 Q = 66 0 ?b I ? b ?bM ? ?bM ? ?bM ? 77 ; 4 5 0 0 0 0 ?b I ? b h h i h i h i h M iiT ; T = IE T ;M ; ; IE T ;NM ; ; IE TM; ; ; IE TM;N 2
0
1
2
0
1
2
1
3
2
1
0
1
2
0
1
2
1
3
2
1
1
0
( ) 01
( 0
h
)
1
(1) 1
(
M = p M; ; ; p M;N ; ; pM;M ; ; pM;N ( ) 01
( 0
)
(
(
) 1
)
iT
)
;
B = ~0; 1; ; 1 T ; A = 0~; aem ; aem ; ; ae T ;
+1
2
where I is an N N identity matrix, 0 is an N N all zeroes matrix, ~0 = (0; 0; ; 0)T , and 1 = (1; 1; ; 1)T are N 1 column vectors,
aem = (IP (X m j Y = i); i 0)T ; 0
and
2
bk =
6 6 6 6 4
Ck0;0 Ck1;1 .. .
0
Ck0;2 Ck1;2
...
Ck0;N Ck1;N .. .
3 7 7 7 7 5
:
CkN ?1;1 CkN ?1;2 CkN ?1;N ?1 h i (M ) One can similarly write the equations for IE n;i and for the higher mo-
ments. An equation corresponding to (4) can also be written and exploited to obtain ecient algorithms. h i (M ) To compute IE Tn;i , the algorithm presented in Section 2.2 can be extended to the Markov modulated case as below.hThis algorithm requires O(MN 3 ) number i (M ?1) of multiplications once the values of IE Tn;i are known. In the following, we h i h iT (M ) (M ) write Tn = IE Tn;0 ; ; IE Tn;N ?1 .
SHARMA and Gangadhar / Algorithms for Finite Discrete Queues
M = 2:
D T = (I ? b )? 1 ; E = (I ? b )? b : T = T = (I ? b ? b ? C E )? (1 + C D T ); T =D T +E T ( ) 2
0
M 3: DMT
( )
17
1
1
1
0
2
1
2
( ) 2
2
~0
=
1
1
1
2
2
0
2
( ) 2
1
!
DMT ? ( )
1
+
I
!
I
EM ?
1
1
!
(I ? b ? CM ? EM ? )? (1 + CM ? DMT ? ); 1
1
1
1
( )
1
EM = EM ? (I ? b ? CM ? EM ? )? b ; CM = (CM ? ; bM ): T = T = (I ? b ? b ? CM EM )? (1 + CM DMT ); (T ; ; TM )T = DMT + EM T : 1
1
1
1
1
0
1
0
1
0
( )
1
1
( )
2
1
Now we obtain a result corresponding to the triangular Toeplitz matrix result (20) of Section 2. Let Ab be a block triangular Toeplitz matrix of the type obtained from R in this section. Let Db be its inverse. Let 2
b b b bM 6 0 b b bM ? 6 6 Ab = 66 0 0 b bM ? 0
6 4
Then a matrix
1
2
0
1
0
.. . 0
0
1
...
0
2
b
d d d dM 6 0 d d dM ? 6 6 b 0 0 d dM ? 6 D=6 1
2
0
1
1
0
2
.. ... . 0 0 0 is its inverse if it satis es Ab Db = I. Thus 6 4
d = b? d = ?b? b d 0
1
0
1
0
1
1
0
d
7 7 7 7 7 7 5
0
2
0
3
0
3 7 7 7 7 7 7 5
SHARMA and Gangadhar / Algorithms for Finite Discrete Queues
18
d = ?b? (b d + b d ) 2
0
1
1
1
2
0
.. . dn = ?b?0 1 (b1 dn?1 + + bnd0 ) Therefore, if b?0 1 exists, then Db of given structure is Ab ?1 . Then computing the inverse of Ab is not expensive once we know the inverse for dimension M ? 1. This canh be readily used when applying the algorithms of Section 2 corresponding to i (M ) 2 IE (Tn;i ) to the Markov modulated case.
4 Numerical Examples In this section we provide some numerical examples. We consider both i.i.d. and Markov modulated cases. First we describe the examples and towards the end of the section we discuss the results and provide some concluding remarks. 4.1 I.I.D. case a) An approximate voice source model Consider an ATM multiplexer whose outgoing link speed is 1.536Mbits/sec. The incoming trac is a superposition of, say, N number of voice calls. Each voice source generates ATM cells (53 bytes) in the following manner: The analog speech waveform is sampled at a Nyquist rate of 8 kbits/s. and each sample is encoded into a 8{bit digital signal (thus the trac generated by an active source is 64 kbits/s). Hence, every 6ms., 48 bytes of information (that can ll an ATM cell) is available from the source. Thus each voice source in its active state generates 166.67 ATM cells/sec. With a buer to take care of the instantaneous excess (above the server capacity of one cell), arrivals from a maximum of 22 voice calls can be served by the multiplexer and the channel. By considering the time of transmission of an ATM cell on the outgoing channel (which is 0.276ms.) as a unit of time, the multiplexer and the output channel can be modelled as a discrete time queue. A voice source in active state generates an ATM cell every 22 slots. In this example, we make the assumption that each of the voice sources can be modelled as a Bernoulli source with parameter p and that the sources are independent. The parameter is xed by matching the mean number of arrivals from the voice source in a slot (which is, as seen above, 1=22) to the mean of the Bernoulli process, p. Thus p = 0:045. With N number of voice sources multiplexed, the load experienced by the multiplexer is Np. We considered two scenarios: one with N = 19, corresponding to a load of
SHARMA and Gangadhar / Algorithms for Finite Discrete Queues
19
0:855, and another with N = 14, which corresponds to a load of 0:63. The corresponding variances h are i0:817h and 0:602. i The quantities IE Ti(M ) , IE (Ti(M ) )2 , p(iM ) , and IE [i (M )] were computed for M = 2; ; 80, i = 0; ; M . The results for N = 14 and N = 19 are plotted in Figures 1 and 2 (The gures include h i results from next example, for ease of (M ) n comparison). As M ! 1, IE (Ti ) ! 1, n = 1; 2, which gets re ected in the denominator in (18) becoming very close to zero. This will naturally lead to numerical problems for large M . Figure 3 plots p(iM ) for M = 2; ; 80 and i = 0; 30; and 60, and Figure 4 plots the computed values of IE [i (M )], for the cases N = 14 and 19. We discuss the results towards the end of this section. b) Non-Binomial Arrival Process In the above example, the overall arrival process to the multiplexer has a Binomial distribution. Next we consider discrete distributions, prob1 and prob9, that are not Binomial, but have (nearly) same means as those in the above example, with 14 and 19 sources, respectively. Table 1 tabulates the two distributions considered. Figures 1{3 incorporate some of the computational results for this example. 4.2 Markov modulated case a) A three state source In this example the discrete time queue is fed by a source which has three states and its motion in the state space f0; 1; 2g is described by a Markov chain evolving in discrete time with transition probability matrix 2 6 4
3
0:5 0:5 0 0:46875 0:1375 0:39375 75 : 0 0:7 0:3
State changes of the Markov chain occur at the slot boundaries and when the Markov chain is in state i; i 2 f0; 1; 2g, the source is in the process of generating i packets which it feeds into the queue at the beginning of the next slot. It is easy to check that the stationary mean number of packets per slot is 0:85 and its variance is 0:5775. The expected rst time to over ow is T0 , where is the stationary probability vector of the Markov chain, and T0 is de ned as in Section 3 ( T0 is the rst time to over ow if the underlying Markov chain starts with stationary distribution and initially the system is empty). Table 2 compares the expected rst time to over ow in this example with the i.i.d. (prob9) case. Figure 5 plots the mean rst time to over ow as a function of the buer size for dierent initial number, n, in the system.
SHARMA and Gangadhar / Algorithms for Finite Discrete Queues
20
b) Superposition of On/O sources This example is related to (infact a re nement of) the approximate voice source model presented in Example 4:1(a). Here, each of the voice sources is modelled as a Markov modulated On/O source. Hence we consider an arrival process that is generated by a superposition of N On/O sources each of which is governed by a two state discrete time Markov chain. A source when in On state generates a packet which it feeds to the queue at the beginning of the next slot. When it is in the O state, it does not generate any packets. The transition probability matrix of each source is "
#
0:98 0:02 : 0:42 0:58
The mean interarrival time of packets from each source is 22 slots, the same as in Example 4:1(a). We considered the case when the number of On/O sources is 19 which corresponds to a load of 0:85 (cf. Example 4:1(a)). The state space of the underlying Markov chain has 20 states where state ihindicates the number of sources that are i (M ) in the On state. The array of values IE Tn;i for i = 0; ; 19, M = 2; ; 80, n = 0; ; M were calculated using thei matrix operating facilities of MATLAB. h (M ) In Figure 5, the quantity IE Ti is plotted as a function of M , for n = 30, 60, and 80 (with i = 0). 4.3 Discussion We discuss some features of the queueing phenomenon brought out by the numerical computations done for the examples presented above. (1) For i and M xed, as the mean arrival rate increases, the moments of Ti(M ) decrease (see Fig. 1 and 2). This simply re ects the fact that the queue builds up more rapidly as the load increases. Also, with the mean xed, increasing the variance of the arrival process results in the moments of Ti(M ) to decrease (Fig. 1 and 2). (2) For a particular distribution, the moments of Ti(M ) are monotonically increasing in M and monotonically decreasing in i. The eect of the initial number in the system, i, on the moments of Ti(M ) is very little (The curves for i = 0; 30 and 40 merge quickly as M increases; see Figures 1, 2, and 5). The reason for this is that the eect of i vanishes once the queue length decreases to zero before an over ow occurs { this happens with probability (1 ? p(iM ) ), which is suciently close to unity for the distributions considered (see Fig. 3). h i (3) In contrast to IE Ti(M ) , even though IE [i (M )] has monotonic properties with respect to i and M , the eect of i is quite pronounced. This is to be expected
SHARMA and Gangadhar / Algorithms for Finite Discrete Queues
21
from Equation (4). Also, for i xed, IE [i (M )] reaches an asymptotic value (equal to IE [i (1)], the corresponding value for the in nite buer case) which depends very much on i (see Fig. 4). h i (4) In the Example 4:2(a) of a 3{state Markov modulated source, IE Ti(M ) ( is the stationary distribution of the underlying Markov chain), are considerably higher than the corresponding i.i.d. example (with input distribution prob9) (see Table 2). In the Markov modulated case the variance is lower than that of prob9 and the maximum number of arrivals in the former case is two while as many as ten packets can arrive in the latter. Also, the arrivals from the 3{state source are positively correlated only to a small extent (the covariance between successive arrivals is 0:2325). (5) Even though the two Markov modulated examples considered have the same mean, the superposition of 19 On/O sources has a larger variance and a higher peak arrival rate. This resulted in lower values of the mean over ow times (see Fig. 5).
Acknowledgement We are thankful to one of the anonymous reviewers for a
close reading of the rst version of the paper leading to the elimination of many errors.
References [1] S. Asmussen. Applied Probability and Queues. John Wiley and Sons Ltd., Chichester, 1987. [2] S. Asmussen and D. Perry. On Cycle Maxima, First Passage Problems and Extreme Value Theory for Queues. Stoch. Models, 8:421{458, 1992. [3] K. Bisidikian, J. S. Lew, and A. N. Tantawi. On the Tail Approximations of the Blocking Probability of Single Server Queues with Finite Capacity. In R. O. Onvural and I. F. Akyildiz, editors, Queueing Networks with Finite Capacity. Elsevier Science Publs., 1993. [4] H. Bruneel. Performance of Discrete Time Queueing Systems. Comp. and Opns. Res., 20(3):303{320, 1993. [5] H. Bruneel and B. G. Kim. Discrete{Time Models for Communication Systems Including ATM. Kluwer Academic Pubs., Dordrecht, The Netherlands, 1993. [6] M. L. Chaudury and Y. A. Zhao. First Passage Times and Busy Period Distributions of Discrete Time Markovian Queues : Geom(n)/Geom(n)/1/N. Queueing Systems, 18:5{26, 1994. [7] W. W. Chu and A. G. Konheim. On the Analysis and Modeling of a Class of Computer Communication Systems. IEEE Trans. Comm. COM, 20(3):645{660, June 1972. [8] I. Cidon, A. Khamisy, and M. Sidi. On Packet Loss Process in High-speed Networks. In Proc. INFOCOM 92, pages 0242{0251. IEEE, 1992. [9] J. W. Cohen. The Single Server Queue. North-Holland, Amsterdam, revised edition, 1982. [10] N. D. Gangadhar. Analysis of Discrete Time Queues with Applications to ATM based B{ISDNs. M.Sc.(Engg.) Thesis, Department of Electrical Engineering, Indian Institute of Science, Bangalore, India, Apr. 1995. [11] P. Glasserman and S. G. Kou. Over ow Probabilities in Jackson Networks. In Proc. IEEE
SHARMA and Gangadhar / Algorithms for Finite Discrete Queues
22
Conf. Dec. and Control, pages 3178{3182, 1993. [12] K. Kobayashi and A. G. Konheim. Queueing Models for Computer Communication System Analysis. IEEE Trans. Comm. COM, 25(1):2{29, Jan. 1977. [13] D. Kofmann and H. Korelioglu. Loss Probabilities and Delay and Jitter Distribution in a Finite Buer Queue with Heterogenous Batch Markovian Arrival Process. In Proc. GLOBECOM 93, pages 830{834. IEEE, 1993. [14] J. W. Pitman. Occupational Measures For Markov Chains. Adv. Appl. Prob., 9:69{89, 1977. [15] N. U. Prabhu. Stochastic Storage Processes : Queues, Insurance Risks and Dams. SpringerVerlag, New York, 1980. [16] J. W. Roberts. COST 224 Final Report { Performance Evaluation and Design of Multiserver Networks. Technical report, COST, 1991. [17] V. Sharma. Reliable Estimation via Simulation. Queueing Systems, 19:169{192, 1995. [18] V. Sharma and N. D. Gangadhar. Asymptotics for Transient and Stationary Probabilities for Finite and In nite Buer Discrete Time Queues. Submitted, 1995. [19] T. Takine, T. Suda, and T. Hasegawa. Cell Loss and Output Process Analysis of a Finite Buer Discrete-Time ATM Queueing System with Correlated Arrivals. In Proc. INFOCOM 93, pages 1259{1269. IEEE, 1993. [20] H. Tijms. Heuristics for Finite Buer Queues. Prob. in Engg. and Info. Sc., 6:277{285, 1992. [21] T. Y. Yen. On The Delay Analysis of a TDMA Channel with Finite Capacity. IEEE Trans. Comm. COM, 30:1937{1941, 1982.
Appendix In this Appendix, we provide a derivation of the expression for stationary probability of packet loss in a nite buer queue in terms of the mean regeneration cycle length. The latter quantity can be computed using the algorithms presented in this paper. Let NL be the number of packets lost in one regeneration cycle (denoted by (M )). Then 3
2
(M )?1 X
[ (M ) ? 1 + NL j (M ) > 1] = 64
k=0
Hence IE [NL j (M ) > 1] = 1 ? IE [ (M ) j (M ) > 1] + IE Now
Xk j (M ) > 175 : (M )?1 X j (M ) > 1: k k=0
P
IP ( (M ) = 1) ; IE [ (M ) j (M ) > 1] = IE [ (MIP)](?(M ) > 1) IP ( (M ) > 1) = IP (X > 0);
SHARMA and Gangadhar / Algorithms for Finite Discrete Queues and
IE
(M )?1 X j (M ) > 1 = IE [ (M )] IE [X ] = IP (X > 0): k k=0
P
Therefore, the stationary probability of packet loss = mean fraction of packets lost . P (M )?1 X j (M ) > 1 = IE [NL j (M ) > 1] IE k=0 k = 1 ? IE 1[X ] 1 ? IE [1(M )]
23