Universität Stuttgart Sample Solution

INSTITUT FÜR
KOMMUNIKATIONSNETZE
UND RECHNERSYSTEME
Universität Stuttgart
Prof. Dr.-Ing. Andreas Kirstädter
Sample Solution
"Teletraffic Theory and Engineering" (TTE)
"Performance Modelling & Simulation" (PMS)
Date:
March 15, 2011
Problem 1
Analysis of Delays of an Internet Transmission Link
Question 1
Service Processes
16 Points
a)
Phase model representations
H2
q
1–q
b)
D2
M
ε1=1/h1
M
ε2=1/h2
q
1–q
Probability density functions
f H2 = qε 1 e
–ε1 t
+ ( 1 – q )ε 2 e
–ε2 t
f D2 = qδ ( t – h 1 ) + ( 1 – q )δ ( t – h 2 )
c)
First and second moment of H2 by means of LST
ε1
ε2
Φ H2 ( s ) = q ------------- + ( 1 – q ) ------------s + ε1
s + ε2
ε1
ε2
Φ' H2 ( s ) = – q --------------------2- – ( 1 – q ) --------------------2( s + ε1 )
( s + ε2 )
2ε 1
2ε 2
Φ'' H2 ( s ) = q --------------------3- + ( 1 – q ) --------------------3( s + ε1 )
( s + ε2 )
q 1–q
m 1 = – Φ' H2 ( 0 ) = ----- + -----------ε1
ε2
2q 2 ( 1 – q )
m 2 = Φ'' H2 ( 0 ) = -----2- + ------------------2
ε1
ε2
D
h1
D
h2
d)
First and second moment of D2 derived in time domain
∞
∞
∫ t ⋅ f D ( t ) dt
m1 =
0
∞
2
f D 2 ( t ) dt =
0
e)
= qh 1 + ( 1 – q )h 2
0
∞
∫t
m2 =
∫ t [ qδ ( t – h1 ) + ( 1 – q )δ ( t – h2 ) ] dt
=
2
∫t
2
2
2
[ qδ ( t – h 1 ) + ( 1 – q )δ ( t – h 2 ) ] dt = qh 1 + ( 1 – q )h 2
0
Variance and squared coefficient of variation for both cases
2
VAR [ T H ] = m 2 – m 1
VAR [ T H ]
m2
2
c H = -----------------------=
------2- – 1
2
m1
m1
Question 2
4 Points
Performance of the pure delay systems M/H2/1 and M/D2/1 (s → ∞ )
a)
Probability of waiting and mean waiting time w.r.t. all arriving requests
W = ρ (in single-server systems, the probability that Poisson arrivals
encounter a non-empty system is equal to the occupancy)
2
ρ ( 1 + cH )
w = ------------------------ m 1 (Pollaczek-Khintchine formula)
2(1 – ρ)
b)
Method of Embedded Markov Chain (EMC).
Remark The LST of the waiting time is obtained from the LST of the service process Φ(s) by the formula
s
ω ( s ) = ( 1 – ρ ) ------------------------------------- (cf. chapter 5.3, page 5)
s – λ(1 – Φ(s))
Question 3
29 Points
Performance of the delay-loss system M/H2/1–s
a)
System state
 0
x = 
 ( x, i )
b)
system is empty
x – number of customers in the system
i – phase number of the current customer being served
State transition diagram
λ
λ
(1,1)
qλ
qε1
ε1
(1-q)λ
qε1
λ
(1,2)
qε1
...
λ
(s+1,1)
λ
(1-q)ε1
qε2
λ
(s,2)
(1-q)ε2
(1-q)ε2
λ (loss)
qε1
(1-q)ε1
qε2
(2,2)
(1-q)ε2
Problem 1
λ
(s,1)
(1-q)ε1
qε2
0
ε2
λ
(2,1)
(s+1,2)
λ (loss)
(1-q)ε2
Page 2
c)
d)
Recursive solution procedure
•
two initial state probabilities for recursion: p(s+1,1), p(s+1,2)
Reason: there is only one transition into each of these states
⇒ the equilibrium equations of these states allow to express
the probability of the states these transitions originate from
(i.e. p(s,1) resp. p(s,2)) by p(s+1,1) resp. p(s+1,2)
•
the equilibrium equations of states (s,1) resp. (s,2) then allow to
express p(s–1,1) resp. p(s–1,2) as functions of p(s+1,1) and p(s+1,2)
•
recursively, the equations for states (j,1) resp (j,2) allow to express
p(j–1,1) resp. p(j–1,2) as functions of p(j,1), p(j,2), p(j+1,1), p(j+1,2)
and in turn of p(s+1,1) and p(s+1,2) – for i = s, ..., 2
•
finally, the equations for states (1,1) and (2,2) yield two expressions for
p(0) as functions of p(s+1,1) and p(s+1,2), which allow to express
p(s+1,2) as a function of p(s+1,1)
•
we can hence express all other state probabilites as functions of
p(s+1,1)
•
p(s+1,1) is then obtained from the normalization condition, and we can
finally express all state probabilites in terms of the system parameters
Complementary cumulative distribution function of the packet delay
C
s
W ( t) = P {TW > t } =
2
∑x = 1 ∑i = 1 p ( x, i ) ⋅ W
C
( t ( x, i ) )
Remark: The delay may be expressed in this way since the PASTA
theorem applies in this case.
e)
Recursive definition of waiting time LST, starting from empty system
Case x = (0):
TW ≡ 0 ⇒ Ψ(s|0) = 1
Case x = (1,i): TW is equal to the residual service time TR, which depends
on the M phase the service process is currently in:
ε1
–ε t
C
CCDFs: W ( t ( 1, 1 ) ) = e 1 ⇒ Ψ ( s ( 1, 1 ) ) = ------------s + ε1
C
CCDFs: W ( t ( 1, 2 ) ) = e
–ε2 t
ε2
⇒ Ψ ( s ( 1, 2 ) ) = ------------s + ε2
Case x = (k,i); 1 < k ≤ s, i = 1,2:an arriving request has to wait for the residual service time of the currently processed request and for
the full service time of all requests already in the queue:
k
TW = TR +
∑ TH, H
2
⇒ Y(s|(k,i) = Ψ(s|(k,i–1))ΦH2(s)
j=2
k–1
⇒ Ψ ( s ( k, i ) ) = Ψ ( s ( 1, i ) )Φ H2 ( s )
where ΦH2(s) is the LST of the H2 service process derived
in Question 1c)
Problem 1
Page 3
Problem 2
Analysis of a Client/Server System (C/S System)
Part 1
Markovian Service Times (Service Process G = M)
Question 1
Distribution of the probabilities of state
23 Points
a)
Dimensioning and properties of the queuing sytstem
a1) smin = n – 1
a2) closed
a3) n
b)
System state variable: X – number of requests in server node
A one-dimensional state space is sufficient
since any “customer” is either at a client node
or at the server node; i.e. n – X customers are
in the think-time phase.
Value range of X: 0, ..., n – there are exactly n customers in the closed
system ⇒ there are at most n requests at the
server node
State transition diagram
nα
0
(n–1)α
1
µ
µ
(n–x+2)α
...
µ
(n–x+1)α
x–1
µ
α
(n–x)α
x
x+1
µ
n
...
µ
Transition rates:
Arrivals at the server node occur upon termination of a think time at a client. In state x, n – x Markovian think time phases are active, each having a
termination rate of α. Hence, the total termination rate of the think times
(i.e. the arrival rate of service requests at the server node) is (n – x) · α.
Departures occur when the single Markovian service phase at the server
node terminates, i.e. with a rate of µ (as long as the server is occupied).
c)
Balance equations
n α p0 = µ p1
((n – 1) α + µ) p1 = n α p0 + µ p2
...
((n – x) α + µ) px = (n – x + 1) α px–1 + µ px+1
...
µ pn = α pn–1
Alternative, simplified formulation
n α p0 = µ p1
(n – 1) α p1 = µ p2
...
(Q – x) α px = µ px+1
...
α pn–1 = µ pn
Problem 2
Page 4
d)
Recursive solution for p1, ..., pn
α
p 1 = n ---p 0
µ
α
α 2
p 2 = ( n – 1 ) ---p 1 = n ( n – 1 )  --- p 0
 µ
µ
...
α x
p x = n ( n – 1 ) ⋅ … ⋅ ( n – x + 1 ) ⋅  --- p 0
 µ
...
n
α
p n = n ( n – 1 ) ⋅ … ⋅ 1 ⋅  --- p 0
 µ
p0 from normalization condition
n
∑x = 0
px = 1 ⇒ p0 ⋅ ∑
n
20 Points
x
α
--- ⋅ n ( n – 1 ) ⋅ … ⋅ ( n – x + 1 ) = 1

x=0 µ
x
α
∑x = 0  --µ- ⋅ n ( n – 1 ) ⋅ … ⋅ ( n – x + 1 )
⇒ p0 =
Question 2
n
–1
Performance Characteristics
a)
Mean queue length at server node
n
Ω =
b)
∑x = 1 ( x – 1 )px
Average arrival rate of client service requests
n
λ =
∑x = 0 ( n – x )αpx
c)
Average waiting time of a client service request
Ω
w = ---- (Little’s law)
λ
d)
Arriving customer state distribution
•
Average number of arrivals at server node during t0 in state x
a x = p x ⋅ ( n – x )α ⋅ t 0
•
Total number of arrivals at server node during t0
n
a =
•
∑x = 0 px ⋅ ( n – x )α ⋅ t0
Arriving service request state distribution
ax
px ⋅ ( n – x )
π x = ----- = ----------------------------------n
a
∑ pi ( n – i )
i=0
Problem 2
Page 5
n
with
∑i = 0
n
pi ( n – i ) =
pin – ∑
∑i = 0
n
i=0
ip i = n – E [ X ]
( n – x )p
π x = ---------------------xn – E[X]
e)
CDF for the response time of a client service request
e1) The response time is composed of the residual service time of the
request serviced upon arrival, the service times of the requests in the
queue in front of the arriving request, and the service time of that
request. If TH is the (negative-exponentially distributed) service time
of one client request, we obtain for a request arriving in state x
TR
x
= T HRes + ∑
x–1
i=1
x
(i)
TH + TH =
(i)
∑i = 0 T H
e2) TR|x is the sum of x+1 i.i.d. negative-exponential random variables
C
⇒ TR|x ~ Erlangx+1 with CCDF R ( t x ) =
i
x
( µt ) – µt
-e
∑i = 0 ---------i!
Law of total probability
n–1
C
R (t) =
∑x = 0
n–1
C
∑x = 0
πx R ( t x ) =
Part 2
General Service Times (Service Process G)
Question 3
EMC analysis for the probabilities of state
30 Points
a)
πx ∑
x
i
( µt ) –µt
-----------e
i = 0 i!
Why EMC?
Server
Node:
Μ (n–x)α
X
arrivals
s
X
G
8
7
6
5
4
3
2
1
ti+0
interarrival
interval
ti+1+0
G service phase
Each end of a (generally distributed) service phase, i.e. ti+0, ti+1+0, ..., is a
regeneration point, since the memory of the G phase ends and the arrival
process is memoryless.
⇒ at ti+0, ti+1+0, ... the future development is independent of the past, i.e. it
can be calculated exclusively based on the current state.
b)
Regeneration points are all instants ti, ti+1, ... where the server finishes one
service phase.
Definition of the state probabilites for the EMC
Πx(ti) = P{X(ti+0) = x}; x = 0, 1, ..., n–1
Problem 2
Page 6
c)
State transitions between two consecutive regeneration points
ti+0
time instants
ti+1+0
j = x+1
j=x
j = x–1
...
j=1
j=0
d)
0
1
2
k
k
x
necessary number of arrivals
during (ti+0, ti+1+0)
resp. during one full service time
in case of j = 0
Formal definition of transition probabilities
qjx = P{X(ti+1+0) = x | X(ti+0) = j}, j= 0, 1, .., x+1
Informal definition based on arrival process
qjx = P{arrival of x–j+1 requests during one service time}; j = 1, 2, ... k+1
q0x = P{arrival of x requests during one service time}
e)
State transition diagram (STD) for pure birth process of arrivals during one
service period starting from system state j
0
(n-j)α
1
(n-j-1)α
2
(n-j-2)α
...
(2α
n–j–1
α
n–j
The state variable in the STD gives the number of arrivals since the begin of
the service phase.
f)
Differential equation system for the non-stationary probabilities of state
(Kolmogorov-Forward-Equations, cf. chapter 3.3, eqation (9))
P0’(t) = – (n – j) α P0(t)
P1’(t) = – (n – j –1) α P1(t) + (n – j) α P0(t)
P2’(t) = – (n – j –2) α P2(t) + (n – j – 1) α P1(t)
...
Pn–j’(t) = α pn–j–1(t)
Initial conditions: P0(0) = 1; Pi(0) = 0, i = 1, ..., n–j
The equation system can be solved by means of the Laplace transform. In
the Laplace domain, we obtain a system of n–j+1 linear equations for n–j+1
unknowns. The solutions are then transformed back to the time domain.
g)
Problem 2
In case of deterministic service times, the transition probabilites of the
EMC are defined by the number of arrivals within the constant holding time
h, i.e. by Pi(h).
q0x = Px(h)
qjx = Px–j+1(h); j = 1, ..., x+1
Page 7
Problem 3
Simulation
Part 1
Generation and Test of Random Numbers
Question 1
Generation of generally distributed random numbers
6 Points
a)
Computation of X from r
Approach: resolve r = F(X) for X
m α
r = 1 –  ---- for X ≥ m (X < m may not occur since the CDF is = 0 there)
 X
m α
m
⇒  ---- = 1 – r ⇒ ---- =
 X
X
α
m
1 – r ⇒ X = ---------------α 1–r
Remark Plausibility check:
X ≥ m holds for the computed values of X, since 0 ≤ r < 1.
b)
Algorithmic steps
1
set X = 1
2
3
4
generate basic random number r
if r > q (failure): increment X and continue with step 2
else (success): output X and finish
(also description in pseudo code possible – as in lecture notes)
Question 2
6 Points
Testing of generated distributions
a)
Critical value: c = F5(1–1%) = F5(0.99) = 15.09
Remark Since we consider K = 6 intervals, we have to select a χ2-distribution with 5 degrees of freedom for testing. For this distribution, the χ2-distribution table yields the above critical value for
the significance level of α = 1%.
b)
For a GEO1 distribution, we expect the following numbers of samples in
each of the specified intervals:
range of X (j)
measured (bj)
expected (ej)
1
33
30
2
18
21
3
13
15
4
12
10
5
6
7
>5
18
17
The normalized deviation is then
2
χ0
c)
2
( ej – bj )
= ∑
--------------------- = … = 1.597
ej
j=1
K
We cannot reject the hypothesis since χ02 < c.
Part 2
Evaluation of Simulation Results
Question 3
During the startup phase, the simulated system converges towards its stationary
state and therefore shows transient behavior. Statistical evaluation, however,
2 Points
Problem 3
Page 8
generally assumes a stationary situation. We therefore need to discard the samples of the initial, unstationary phase.
Question 4
Statistical evaluation of the mean queue length
8 Points
a)
b)
1 5
x = --- ∑
x =4
5 i=1 i
The batch means are computed as averages of 100 samples each, which are
taken from the same, unknown distribution. They thus obey a normal distribution of an unknown mean µ. The normalized fluctuation of the batch
means around µ hence follows a Student-t distribution with N – 1 degrees
of freedom. This allows us to derive the confidence intervals as follows.
In addition to the overall sample mean x , we obtain the sample variance of
the means of the N = 5 batches as
N
2
1
2
S = ------------- ∑
( x i – x ) = 5.15
N–1 i=1
and compute the sample standard deviation S = 2.27.
For the required confidence level of 90%, we obtain a 95% quantile of
tl,4 = 2.13 from the CDF table for a t-distribution with 4 degrees of freedom.
Therewith, the confidence interval is
S
S
x – t l, 4 ⋅ -------- < µ < x + t l, 4 ⋅ -------- ⇒ 4 – 2.16 < µ < 4 + 2.16
N
N
⇒ 1.84 < µ < 6.16
Part 3
Simulation Technique
Question 5
Simulator components
7 Points
a)
Active system entities are modeled as event handlers. These event handlers
organize their individual time axes by issuing events. An event scheduler
(calendar) keeps track of these events. The scheduler always calls the event
handler of the temporally next event, i.e. the event at the head of the list.
The system time advanced to this point in time.
b)
Rate-based simulation
•
requires random number generation since the system behavior, e.g.
rate changes, are generally controlled by random processes
•
requires system time management since rate changes are events on the
time axis
Monte-Carlo simulation
Problem 3
•
requires random number generation since it models random experiments
•
does not require system time management since it has no notion of
time but models repeated, independent executions of the experiment
Page 9
Question 6
10 Points
Simulator design
a)
Yes. Unlike for a continuous-time system, we can use a discrete “counter”
variable for the system time in a simple, time-discrete simulation. This
variable is incremented in a loop.
b)
Additional state information is not required. Due to the memoryless property of the GEO1 processes, an arrival occurs in each time increment with
a constant probability of qA and a departure with probability qS (if the
system is not empty). We can thus draw two random numbers r1,2 during
each iteration and assume an arrival if r1 < qA and a departure if r2 < qS.
c)
Four possible combinations:
•
no arrival, no departure → X unchanged
•
one arrival, no departure → X increased by one
•
no arrival, one departure → X decreased by one
•
one arrival, one departure → X unchanged
Departures, i.e. the lower two cases, can only occur if X > 0 prior to the
current interval.
d)
Pseudo code of the simulator
X = 0;
t = 0;
while (true) {
if (X > 0) {
if (qS < rand()) {
X = X - 1;
}
}
if (qA < rand()) {
X = X + 1;
}
t = t + 1;
}
Remark: the time counter t is optional since not required for the update of X
Problem 3
Page 10