You are on page 1of 123

Network Performance

Bononi and Ferrari's handouts

February 10, 2015

1
Contents

1 Network performance analysis 5


1.1 Network concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1.1.1 Arrival and departure process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1.1.2 Steady-state network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1.2 Little's law . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1.2.1 Example (the Milan's toll barrier) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

1.3 Stable networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

1.3.1 Stability condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

1.3.2 Occupation fraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

1.3.3 Example (the doctor's queue) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

1.3.4 Lost client fraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

1.3.5 Saturation throughput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2 The arrival's process 13


2.1 The Poisson process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.1.1 Properties of a Poisson process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.2 Renewal processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2.2.1 Renewal theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

2.2.2 Example (single-server queue) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

2.3 Age and residual lifetime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

2.3.1 Inspection paradox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

2.3.2 Memoryless random variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

3 The single-server queue (M/G/1) 27


3.1 Pollaczek-Khinchin's formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

3.2 Particular cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

3.2.1 Exponential service time (M/M/1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

3.2.2 Deterministic service time (M/D/1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

3.2.3 Relations between service times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

3.3 M/G/1 with vacations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

3.4 M/G/1 with setup time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

4 Shared medium networks: performance analysis 34


4.1 Ideal Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

4.1.1 Ideal average delay time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

4.1.2 Ideal network throughput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

4.1.3 Ideal performance graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

4.2 Static sharing: TDMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

4.2.1 Average delay time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

4.2.2 Throughput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

4.2.3 Performance graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

4.3 Static sharing: FDMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

4.3.1 Average delay time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

4.3.2 Throughput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

4.3.3 Performance graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

2
4.4 Aloha . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

4.4.1 Throughput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

4.4.2 Average delay time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

4.4.3 Performance graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

4.5 Shared medium network in brief . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

4.6 The trac light . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

4.6.1 Deterministic service time approximation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

4.6.2 Short turn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

4.6.3 Straight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

4.6.4 Long turn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

4.6.5 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

4.7 Ethernet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

4.7.1 Saturation throughput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

4.7.2 Example (typical ethernet saturation throughput) . . . . . . . . . . . . . . . . . . . . . . . . 47

4.8 Token-ring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

4.8.1 Saturation throughput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

4.9 Polling Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

4.9.1 Comparisons with ideal controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

4.9.2 Exercise (proofs on polling system) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

5 Mesh networks: performance analysis 54


5.1 Kleinrock's hypothesis and routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

5.1.1 Example (rough routing of a mesh network) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

5.2 Number of hops impact on the network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

5.2.1 Manhattan street network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

5.2.2 Shuenet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

5.2.3 Throughput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

5.2.4 Delay time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

5.2.5 Performance graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

5.3 The Moore bound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

5.4 The roundabout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

5.4.1 Network model of a roundabout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

5.4.2 Throughput S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

5.4.3 Service time S̄ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

5.4.4 Waiting time W̄ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

5.4.5 Network delay D̄ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

5.4.6 Performance graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

6 Discrete Time Markov Chains (DTMC) 67


6.1 DTMC denitions and properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

6.1.1 Probability of a path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

6.1.2 PMF at the n-th step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

6.2 DTMC as a LTI system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

6.2.1 BIBO stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

6.2.2 The stationary distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

6.2.3 Example (the limiting distribution in a slotted source) . . . . . . . . . . . . . . . . . . . . . . 70

3
6.3 The limiting distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

6.4 State classication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

6.5 Recurrence: type of classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

6.5.1 Type of recurrency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

6.5.2 Limiting distribution in ergodic chains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

6.6 Canonical form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

6.6.1 Canonical form of P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

6.7 Geo/Geo/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

6.8 Stationary distribution with ow balance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

6.9 Geo/Geo/1/B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

6.9.1 Throughput and loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

6.9.2 Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

6.10 Slotted aloha . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

6.10.1 Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

6.11 M/G/1 queue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

6.11.1 Alternative method: Probability Generating Functions . . . . . . . . . . . . . . . . . . . . . . 99

6.12 M/G/1/B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104

6.12.1 Example: M/G/1/B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

6.12.2 Example: CSMA-CD with mini-slot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106

7 Absorbing Markov Chains 111


7.1 Some questions about AMCs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111

7.1.1 Answer to 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112

7.1.2 Answer 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

7.1.3 Answer 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

8 Continuous Time Markov Chains (CTMC) 117


8.0.4 Counting Poisson Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

8.1 Sojourn time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

8.1.1 Constructive view of a DTMC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

8.2 Distribution at time t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120

8.2.1 How is madeΓ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

8.3 Steady-state distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122

9 Semi-Markov Processes 123

4
1 Network performance analysis

1.1 Network concepts

Figure 1:

A network is a system that oers telecommunication services to clients. Services can be calls, if is a classical

telephone network, or packets, if is a data network.

1.1.1 Arrival and departure process


The arrival process can be depicted as follows.

Figure 2:

Pi
Where X is an arrival, Xi are the interarrival times and ti = j=1 Xj are the arrival times.

Dene two important random variables

A(t) = {# of arrivals in [0, t]}

A(t)
= {#time average of arrivals on [0, t]}.
t
From now on it's supposed that the time average exists and is called arrival rate

5
 
A(t) . arrrivals
lim =λ .
t→∞ t second
The same we did for the arrival process can be done for the departure process.

Figure 3:

Where, in this case, P (t) = {# of departures in [0, t]}.

1.1.2 Steady-state network

Figure 4:

A networks is said to be steady-state (or at equilibrium) when the departure and arrival rate are balanced

 
P (t) A(t) arrrivals
lim = lim =λ .
t→∞ t t→∞ t second

1.2 Little's law


For every steady-state network is valid the following law

The long-term average number of clients in a stable system Q̄ is equal to the long-term average arrival
rate, λ, multiplied by the average time a client spends in the system, D̄.

Q̄ = λD̄

Where algebraically the long-term average number of clients in the system is dened as

6
Figure 5:

ˆt
1
Q̄ = lim q(τ )dτ
t→∞ t
0

Q(t) = {# of clients in the network at time t}

This law is the most general law valid for a steady-state network.

Proof (Little's law)


Visualizing the life of a client using an indicator function. It will be 1 if the client is in the network and 0 otherwise.

Figure 6:

7

 1 client in the network
Ij (t) =
 0 otherwise

Thus

Figure 7:

Q(t) can be written as


1


X
Q(t) = Ij (t).
j=1

Hence by the denition we gave of Q̄ we can write

ˆt ˆt X
∞ ∞ ˆt
1 1 1X
Q̄ = lim Q(τ )dτ = lim Ij (τ )dτ = lim Ij (τ )dτ
t→∞ t t→∞ t t→∞ t
0 0 j=1 j=1 0

where the integral of the function Ij is equal to Dj as it follows

Thus writing everything with these considerations and remembering that the number of arrivals in [0,t] is yet

dened as A(t) we obtain

A(t)
1X
Q̄ = lim Dj
t→∞ t
j=1

that can be simplied using a simple trick and remembering from probability theory the Law of Large Numbers
2

1 Note that the sum is over all clients of the network (arrived and arriving). If they are not in the network at time t the value of the
indicator function will be zero.
2 Law of Large Numbers (LLN):
X1 + X2 + ... + Xn
lim = X̄
n→∞ n
if {Xi }are random variable weak correlated and with the same mean X̄ .

8
Figure 8:

A(t) A(t)
1 A(t) X A(t) 1 X
Q̄ = lim Dj = lim · Dj = λ · D̄
t→∞ t A(t) t→∞ t } A(t) j=1
j=1 | {z
| {z }


1.2.1 Example (the Milan's toll barrier)


At the Milan's highway toll barrier there are C = 20 active tolls. The arrival rate of the cars is λ =
cars
30 minute .

1. Knowing that at the barrier on average there are 180 cars, evaluate the average time spent by each car at the
barrier.
2. Knowing that the average time service of every toll is 20 seconds, evaluate the average number of busy tolls.

Generally every network can be represented as a queue, as depicted in the example. The system has a certain

number or servers (tolls in this case) that serve the queue of clients (cars in this case).

For instance, in the packet networks the servers are the channels and the packets are the clients (packet switch-

ing). In the telephone networks the clients are the incoming calls and the servers are the input output pairs (circuit

switching).

Solution point 1 In the highway toll barrier example applying the Little's law at the whole network we have

Q̄ 180
Q̄ = λD̄ ⇒ D̄ = = = 6 min
λ 30
So every car stays 6 minutes, on average, at the barrier. 20 seconds will be spent at the toll (to pay) and the

other time is waiting in the buer. 

9
Figure 9:

Solution point 2 Little's law has to be applied at the the subnetwork of servers (tolls). If the network is steady-

state the arrival rate doesn't change but it changes the average service time S̄ = 20 sec. Hence, said N¯C the average

number of busy tolls, applying the Little's law we obtain:

 
30
N̄C = λS̄ = · 20 = 10 busy tolls
60
By the fact that the number of tolls is 20, to have a stable network (a network capable to serve all the incoming

trac) is necessary that N̄C < C . 

1.3 Stable networks


A network is said to be stable if it is capable to serve all the incoming trac.

1.3.1 Stability condition


Algebraically a network is said to be stable if it respects the stability condition

λS̄ < C

Where C is the the total number of servers in the network. λS̄ is called trac intensity and it's measured
in Earlang.
´
Note If λS̄ ≥ C it is not possible to reach a steady state regime (equilibrium), thus Q = limt→∞ 1
t Q(τ )dτ −→ ∞
and Little's law is not valid anymore.

Note arrivals

λS̄ = second ·(second) is the average number of arrivals during the average service time.

1.3.2 Occupation fraction


In a network the occupation fraction can be dened as

. N̄C λS̄
ρ= = .
C C

10
Moreover can be proved that the occupation fraction is the probability to nd a server busy at time t

ρ = P {server busy at time t}.

In a work conserving
3 single server network can be found the probability of nd the server idle

P {server idle at time t} = 1 − ρ = 1 − λS̄.

1.3.3 Example (the doctor's queue)


At the doctor's are queueing, on average, 15 persons (doctor's studio and waiting room). Moreover 3 persons per
10 minutes are arriving, on average.
1. Evaluate the average time spent at the doctor's.
2. How long a visit has to be, on average, to have a stable system? What is the visit time is too long?

Figure 10:

Solution point 1 Assume that the system is steady-state, thus the arrival and departure rate are the same.

Applying Little's

Q̄ 15
D̄ = = 3 = 50 mins
λ 10

Where D is the average time spent at the doctor's (studio and waiting room). 

Solution point 2 Applying Little's at the server (the doctor) we obtain the trac intensity (Earlang)

ρ = λS̄

knowing that there is only one doctor and applying the stability condition

ρ = λS̄ < 1

1
S̄ < = 3.3̄ mins
λ
3 A work conserving network is a network that works always when there are clients to be served. Say a non-lazy network.

11
This is the maximum average visit time to have a stable system.

What if the average visit time it's of 10 mins?


 
3
λS̄ = · 10 = 3 Earlang
10
thus, to have a stable system, 3 doctors are needed (at least). If there is only one doctor the waiting room will

be crowded and full soon. There will be a time when the waiting room will be not able anymore to receive any

other clients: those are lost clients.

Figure 11:

A fraction of the clients will be lost (λp ) and a fraction will be served (λi ). The throughput is the rate of the

clients that successfully depart from the network (λi ).

Little's applied at this network gives:

Q = λi D̄

Where D̄ is the delay time of the clients that enter in the network. 

1.3.4 Lost client fraction


λp
pl = = Lost clients f raction
λ
it can be proved that pl is the probability that a new client arriving in the network is lost.

Thus the network's throughput is related to the arrival rate and to the lost probability as it follows

λi = λ(1 − pl )

1.3.5 Saturation throughput


In a system with C servers the stability condition implies that λi S̄ < C , thus the throughput is upper bounded as

follows

C
λi < = Satutation throughput

This is said saturation throughput and it's the maximum trac aordable by the network.

12
2 The arrival's process

To represent the arrival's process the most used tool is the Poisson process.

2.1 The Poisson process

Figure 12:

Consider a timeline divided in nite time intervals called slots (∆t).

In each slot can there can be 1 arrival, with probability p, or 0 arrivals, with probability 1 − p. Thus we avoid

the possibility of group arrivals.

Each arrival is independent from the others in dierent slots.

This model well suit the scenario of independent arrivals (e.g. clients do not date and do not agree on the arrival

time).

Now it is reduced to zero the length of a time slot, ∆t → 0, hence the probability of an arrival would tend to
p
zero: p = ∆t · λ. The average number of arrivals per time unit is forced to remain equal:
∆t = λ. A process built

this way is said to be a Poisson process.

Figure 13:

2.1.1 Properties of a Poisson process


Here a list of the main properties of a process of this kind.

Property 1 (Poisson distribution)

Figure 14:

The number of arrivals on an interval of length T, A(T ), is a Poisson random variable with expected equal to

λT .

13
(λT )k
P {A(T ) = k} = e−λT k = 1, 2, 3..
k!

Figure 15:

Figure 16:

Proof P1 The probability of k success on an interval T divided in N time slots of length ∆t is binomial.

!
N
P {A(T = N ∆t) = k} = pk (a − p)N −k
k

N! N (N − 1)...(N − (k − 1)) k
= pk (1 − p)N −k = p (1 − p)N −k =
k!(N − k)! k!
T
As it's well known p = ∆t · λ. In this particular case ∆t = N , hence ∆t → 0 ⇒ N → ∞. Thus

 k  
N (N − 1)...(N − (k − 1)) λT λT N −k
= (1- ) =
k! N N

(λT )k
      
N N −1 N − (k − 1) λT N −k
= ... · · (1 − ) .
N N N k! N
Now evaluating the limN →∞ we obtain

(λT )k (λT )k −λT


      
N N −1 N − (k − 1) λT N −k
lim ... · · (1 − ) = ·e
N →∞ N N N k! N k!
indeed the Poisson distribution. 

Property 2
If A(T1 ) and A(T2 ) are the arrivals on two dierent and disjoint time intervals, hence A(T1 ) and A(T2 ) are inde-

pendent random variables.

14
Figure 17:

Property 3 (Interarrival times)

Figure 18:

In a Poisson process of rate λ, the interarrival times {Xi } are independent and negative exponential random

variables with expected λ.



 λ · e−λx x≥0
fX (x) =
 0 x<0

Proof P3 The interarrival times (expressed in slots) have a geometric distribution as it follows

P {S = 1} = (1 − p)i−1 p

That means that we have i−1 unsuccesses and at the end one success.

The interarrival time in second is the number of slots multiplied by the duration of a slot, X = S · ∆t.
With what stated above it's evaluable the cumulative distribution function of the interarrival times

x
FX (x) = P {X ≤ x} = 1 − P {X > x} = 1 − P {S < }=
∆t
x
∆t is treated as an integer (the integer number of consecutive intervals without an arrival), thus

x
= 1 − (1 − p) ∆t =

from the Poisson process denition it's known that p = ∆t · λ, hence

x
= 1 − (1 − ∆t · λ) ∆t .

Applying now the lim∆t→0

x
lim 1 − (1 − ∆t · λ) ∆t = 1 − e−λx .
∆t→0

15
Figure 19:

Finally it's proved that FX (x) = 1 − e−λx is the cumulative distribution function of the interarrival times. This

is the CDF of a exponential random variable of parameter λ.



 λ · e−λx x≥0
FX (x) = 1 − e−λx ⇒ fX (x) = 
 0 x<0

Property 4 (n-th arrival time)


The n-th arrival time is a random variable with distribution Earlang(λ, n − 1)

(λt)n−1
ftn (t) = λe−λt t≥0
(n − 1)!

Proof P4 From the gure it's evident that {tn ≤ t} ≡ {A(t) ≥ n}. Thus


X (λt)j
Ftn (t) = P {tn ≤t}=P{A(t)≥n} = e−λt
j=n
j!

d
because of A(t) ∼ P oisson(λt). Derive on
dt :

16
Figure 20:

Figure 21:

∞ ∞
X (λt)j X −λt (λt)j−1 (λt)n−1
ftn (t) = − λe−λt + λe = λe−λt 
j=n
j! j=n
(j − 1)! (n − 1)!

Property 5
The sum of two independent Poisson processes is Poisson too. The rate of the sum it's the sum of the rates.

Proof P5 Proof is valid for the sum of n processes. The process sum is modeled as it follows

n
X
A(t) = Ai (t)
i=1

where Ai (t) are all independent and Poisson processes.

The probability of having at least one arrival per slot is

P {at least one arrival per slot} = P {arrival on A1 } + P {arrival on A2 } + ... + P {arrival on An }

17
Figure 22:

= p1 + p2 + ... + pn = ∆t · (λ1 + λ2 + ... + λn )

Then the probability of having at least two arrivals per slot is

P {at least two arrival per slot} = P {arrival on A1 and A2 } + P {arrival on A1 and A3 } + ...

= ∆t2 · ((λ1 + λ2 ) + (λ1 + λ3 ) + ...)

Thus applying the lim∆t→0 this last probability is negligible. So remains only


 P {1 arrival} = ∆t · λ Pn
with λ = i=1 λi
 P {0 arrivals} = 1 − ∆t · λ

Yet the denition of a Poisson process (P oisson(λ)). 

Property 6 (Random splitting)


If is built the machine in the gure: a random splitter that split randomly (with probability p and 1 − p) and

independently a Passion's arrival in the channel 1 or in the channel 2. The distributions of the arrival processes are

18
Figure 23:

A1 (t) ∼ P oisson(p · λ)

A2 (t) ∼ P oisson((1 − p)λ)

and they are independent one from each other.

Proof P6 Algebraically it's written


X
P {A1 (t) = n, A2 (t) = m} = P {A1 (t) = n, A2 (t) = m|A(t) = i} · P {A(t) = i}
i=0

and all the element is the sum is equal to 0, except for i = n + m, thus

= P {A1 (t) = n, A2 (t) = m|A(t) = m + n} · P {A(t) = m + n}

and because A(t) is a Poisson process

(λt)m+n
= P {A1 (t) = n, A2 (t) = m|A(t) = m + n} · e−λt
(m + n)!
and trivially the rst probability is binomial

!
m+n (λt)m+n
= pn (1 − p)m · e−λt
n (m + n)!

e−λ·t·p (λ · t · p)n e−λ·t·(1−p) (λ · t · (1 − p))m


= ·
n! m!
Hence they are two Poisson distributed random variable. From the independence comes the multiplication in

the middle.

Property 7 (PASTA - Poisson Arrivals See Time-Averages)


Consider a steady-state network. Dene

19
Figure 24:

Πk = P {Q(t) = k}

as the probability mass function of the system number Q (the number of clients in the system).

The PMF of the number Q seen from an arrival is

ΠAT
k = P {Q(t) = k|A(t, t + δt) = 1}

thus there is an arrival an instant after t.


For Poisson arrivals trivially (because of the independence from the past of A(t, t + δt)) is valid the following

Πk ≡ ΠAT
k

that means that the Poisson arrivals see time-averages.

Counterexample When we deal with group arrivals an arrival does not see the time-averages. The system seems

to be more crowded because of the other clients of the group.

2.2 Renewal processes

Figure 25:

Consider a sequence of events as in the picture. The interarrival times {Xi } are independent random variables

identically distributed (IID), with the same expected X̄ < ∞ and Xi ≥ 0.

20
The process A(t) is called the renewal counting process. Every event it's called renewal. The terminology it's

related to the reliability theory where the interarrival times represent the device's lifetime.

The Poisson process is a renewal process where {Xi } are exponential.

The processes studied in the network performance are usually renewal process.

2.2.1 Renewal theorem


If {Xi } is IID with expected X̄ , thus
A(t) 1
lim = w.p. 1
t→∞ t X̄
A(t)
So, by the fact that
t is the average number of renewal per second, there is a renewal every X̄ seconds.

Figure 26:

Proof Consider a epoch t in between the n-th and the (n+1)-th renewal.

It is valid the following

tn ≤ t < tn+1

and this relation remains valid if we divide by n = A(t)

tn t tn+1
≤ <
n A(t) n

n n+1
1X t 1X
Xi ≤ < Xi
n i=1 A(t) n i=1

As stated so far, applying the limit it's trivial to see that t → ∞ ⇒ n → ∞, thus remembering the law of large

numbers

t A(t) 1
X̄ ≤ < X̄ ⇒ → 
A(t) t X̄

21
2.2.2 Example (single-server queue)

Figure 27:

Consider a single-server queue. The server works this way: it can have a job to work on (busy period) or it can
be jobless waiting for something to do (idle period). The life of a server is an alternate sequence of busy and idle
periods called cycles.

Figure 28:

The function IB (t) is the activity indicator function and it is dened as



 1 server busy
IB (t)
 0 server idle

the length of the i-th cycle is dened as

Xi = Bi + Ii

Suppose that {Xi } are IID.


Prove the long-term activity fraction (the fraction of time in which the server is busy) is

ρ= .
B̄ + I¯

Solution The beginning of every cycle is a renewal. The length of the cycle is what we call interarrival time (Xi )

and the number of cycles is the number of renewals (A(t)).

The long-term activity fraction is

´t PA(t) PA(t)
0
IB (τ )dτ 0 Bi A(t) 0 Bi 1
ρ = lim = lim = lim · = · B̄
t→∞ t t→∞ t t→∞ t A(t) X̄
where we used the renewal theorem and the law of large numbers.

22
Thus, knowing that the cycle time is X̄ = B̄ + I¯, the ρ can be written as


ρ= 
B̄ + I¯

Note This proof and the proof of the Little's law are very close one to each other.


 ρ = λS̄ Little
 ρ = λ B̄ Activity f raction
B

1
where λB = B̄+I¯
. This justify the interpretation we give in the beginning of ρ as the utilization fraction (and

not just the average number of clients on the server).

Furthermore, for every single-server queue, it's valid the following

ρ
B̄ = · I¯
1−ρ

2.3 Age and residual lifetime

Figure 29:

Consider the renewal process A(t) with the sequence IID {Xi }. Set t and an observation epoch.

Dene




 Y = XA(t)+1 livetime of the device f ound alive at t

E age of this device



 R residual lif etime of this device

Thus Y = E + R.

2.3.1 Inspection paradox


It can be proven (not in this course) that:

yfX (y)
 fY (y) = E[X] y≥0
t→∞⇒
 f (t) =
R fE (t) = 1−F X (t)
E[X] t≥0

Note The paradox stays in the following result

ˆ ∞
´
yfX (y) y 2 fX (y)dy E[X 2 ] E[X]2 + V AR[X] V AR[X]
E[Y ] = y· dy = = = = E[X] + .
0 E[X] E[X] E[X] E[X] E[X]
V AR[X]
Because
E[X] ≥ 0, the lifetime of an object found alive at instant t is grater than the lifetime of a generic

object.

23
In other words it is more probable to sample an object with a long life.

Note Moreover from what stated above

E[Y ] E[X 2 ]
E[R] = E[E] = = .
2 2E[X]

Proof (partial) fY (y) is given, because it is derived from a dicult theorem (Blackwell theorem). fR and fE
can be proven knowing fY (y).
The idea behind the proof is the following.

Figure 30:

The sample epoch t can be everywhere on the Y interval. If Y =y then


1

y 0<t<y
fR|Y (t) = fE|Y (t) =
 0 t>y

Figure 31:

By the Total Probability Theorem (TP):

ˆ ∞ ˆ ∞
1 yfX (y) 1 1 − FX (t)
fR (t) = fR (t|Y = y)fY (y)dy = · dy = · P {X > t} =
0 t y E[X] E[X] E[X]
ˆ ∞ ˆ ∞
1 yfX (y) 1 1 − FX (t)
fE (t) = fE (t|Y = y)fY (y)dy = · dy = · P {X > t} = 
0 t y E[X] E[X] E[X]

24
Note (Poisson arrivals) In the case of a poisson arrival the interarrival time is exponential. Thus

Xi ∼ exp(λ) ⇒ V AR[X] = E[X]2 ⇒ E[X 2 ] = 2E[X]2

E[X 2 ] 2E[X]2
⇒ E[R] = = = E[X]
2E[X] 2E[X]
The residual time has the same expected of the interarrival time. It is like the process forget about the past

after the observation. This is an example of absence of memory.

Poisson is said to be a memoryless process and the exponential is a memoryless random variable.

2.3.2 Memoryless random variables


A random variable is said to be memoryless if, ∀t ≥ 0, s ≥ 0 it is valid the following

P {T > t + s|T > s} = P {T > t}

Note (exponential random variable) In the exponential random variable case it's easy to prove that the

memoryless property is valid.

P {T > t + s, T > s} P {T > t + s} e−λ(t+s)


P {T > t + s|T > S} = = = = s−λt = P {T > t}
P {T > s} P {T > s} e−λs
It is proven that the exponential random variable is the only memoryless continuous random variable.

It is proven that the geometrical random variable is the only memoryless discrete random variable.

The memoryless property is essential for the Markov chains.

Note (M/G/1) It's yet studied the behavior of a queue with a single server. Here some extras about a single-

server queue with exponential interarrival times (hence memoryless).

Using the Kendall notation a queue of this kind is called M/G/1:

• Memoryless interarrivals;

• Generic service times;

• 1 server.

If the arrivals are Poisson, the time that is in-between the last departure and the next arrival (called Idle time) is

∼ exp(λ), by the memoryless property. Thus

1
I ∼ exp(λ) ⇒ I¯ = .
λ
From the results yet achieved

ρ ρ 1 S̄
B̄ = · I¯ = · = M/G/1
1−ρ 1−ρ λ 1−ρ
where ρ = λS̄ is the server utilization fraction.

Moreover, said NB the number of clients served in one busy period, the length of the busy period will be

NB
X
B= Sj
j=0

25
thus, by the expectation theorem (ET)

B̄ = N̄B S̄

Looking at the result achieved right above

1
N̄B = M/G/1.
1−ρ

26
3 The single-server queue (M/G/1)

3.1 Pollaczek-Khinchin's formula

Figure 32:

Under certain hypotheses, in a single server queue, is possible to correlate the average number of clients in the

system Q, the average waiting time D linked to the arrival rate λ and the service time.

Suppose that:

Hp1 The system is work conserving

Hp2 Service times are independent from interarrival times

Hp3 Arrivals are Poisson

Said W = time spent in the buf f er (D = W + S ), it is proven that

λS¯2
W̄ = , ρ = λS̄ (P ollaczek − Khinchin0 s f ormula).
2(1 − ρ)
From Pollaczek-Khinchin's and Little's

ρ(1 + CV2 ) ρ(1 + CV2 )


   
Q̄ = ρ 1 + ; D̄ = S̄ 1 +
2(1 − ρ) 2(1 − ρ)
q
V AR[S]
where CV , S̄ 2
is called service variation coecient.

Proof Pollaczek-Khinchin is proven using a FIFO queue, though the formula holds for any policy.

Figure 33:

27
Look at a client arriving in the queue (test client). It arrives alone because of Poisson arrivals. When it arrives

it nds N clients in the buer and 1 client in the server.

Dene

R = residual time of the client in the server

the time spent in the buer by the test client is

N
X
W =R+ Sj seconds.
j=1

This result is valid for a work conserving server (Hp1).

Applying the average

W̄ = R̄ + N̄ · S̄.

This result is valid for Poisson arrivals. PASTA property assure that W̄ and R̄ seen from the test client coincide
with the time averages.

Now is possible to proceed to the evaluation of N̄ and R̄.


N̄ can be found applying Little's law to the buer

N̄ = λ · W̄

thus

W̄ = R̄ + λS̄ · W̄

W̄ = R̄ + ρ · W̄


W̄ = .
1−ρ
Only remains to evaluate R̄.
The process r(t) = residual service time can be drawn as it follows

Figure 34:

The time average is

ˆ t P (t)
1 1 X Si2
R̄ = lim r(τ )dτ ' lim
t→∞ t 0 t→∞ t 2
i=1

28
Si2
where P (t) = number of departures in [0, t], 2 is the area of the i-th triangle and the approximation is reason-
able because of the limt→∞ .

Is yet stated that is t → ∞ ⇒ P (t) → ∞, hence

P (t)
P (t) 1 X Si2 S¯2
R̄ = lim · =λ·
t→∞ t P (t) i=1 2 2

as usual applying the denition of rate λ and the law of large numbers.

Finally

λS¯2
W̄ = 
2(1 − ρ)

3.2 Particular cases


Remember the Pollaczek-Khinchin after Little's

ρ(1 + CV2 )
 
Q̄ = ρ 1 +
2(1 − ρ)

3.2.1 Exponential service time (M/M/1)


ρ
If the service time is exponential then CV = 1 ⇒ Q = 1−ρ .

3.2.2 Deterministic service time (M/D/1)


h i
ρ
If the service time is deterministic then CV = 0 ⇒ Q = ρ 1 + 2(1−ρ) , that is the minimum achievable.

3.2.3 Relations between service times


It's drawable the following

Figure 35:

From which we understand that to minimize the number of packet in the queue (i.e. lowest queue occupation

and waiting time) we should use xed size packets. Indeed the service time is related to the size of the packets.

29
3.3 M/G/1 with vacations
The M/G/1 with vacations is a not work-conserving network.

At the end of a busy period the server takes a vacation of random duration V1 . At the end of it if the queue is

still empty it takes another vacation of random duration V2 , otherwise it starts to serve the clients in the buer.

And so forth.

Suppose that {Vi } are independent from all the others.

It is proven that the average time spent in the buer is

λS¯2 V¯2
W̄ = + M/G/1 with vacations
2(1 − ρ) 2V̄

Proof The proof ows as in the case of no vacation. The dierence stays in the evaluation of the residual time.

Remember


W̄ = .
1−ρ
The residual time process in this case is the following

Figure 36:

Dene


 P (t) = number of departures in [0, t]
.
 L(t) = number of vacations in [0, t]

Because of the stability of the system

P (t) ρ
lim =λ=
t→∞ t S̄
similarly

L(t) 1−ρ
lim = .
t→∞ t V̄
Now everything is settled to evaluate the residual time. From the gure

ˆ
 
t P (t) L(t)
1 1  X Si2 X Vi2 
R̄ = lim r(τ )dτ ' lim +
t→∞ t 0 t→∞ t 2 2
i=1 i=1

P (t) L(t)
1 X Si2 1 X Vi2
= lim + lim
t→∞ t 2 t→∞ t 2
i=1 i=1

30
P (t) L(t)
P (t) 1 X Si2 L(t) 1 X Vi2
= lim · + lim ·
t→∞ t P (t) i=1 2 t→∞ t L(t) i=1 2

S¯2 (1 − ρ) V¯2
=λ· + · .
2 V̄ 2
Hence, nally

λS¯2 V¯2
W̄ = + 
2(1 − ρ) 2V̄

3.4 M/G/1 with setup time


The M/G/1 with set up time is a not work-conserving network.

At the end of a busy period the server shut down. When a new client comes the server takes a stochastic warm

up time before starting working. For instance the copying machine is a system like this.

The rst client of a busy period seems to have a service time of T + S, that is dierent from the other clients.

In this case the average time spent in the buer, W̄ , is

λS¯2 2ρT̄ + λT¯2


W̄ = +
2(1 − ρ) 2(1 + λT̄ )
and the average total time spent in the system, T̄s , is

λS¯2 2T̄ + λT¯2


 
T̄s = W̄ + S̄ˆ = S̄ + +
2(1 − ρ) 2(1 + λT̄ )

Proof The proof ows as so far until


W̄ = .
1−ρ
The residual time process, r(t), in this case is represented as the picture below

Figure 37:

Dene


 P (t) = number of departures in [0, t]
.
 L(t) = number of busy periods in [0, t]

Because of the stability of the system

31
P (t)
lim =λ
t→∞ t
and

L(t)
lim = λB .
t→∞ t
1
Where λB == B̄+I¯
is the busy periods arrival rate, as stated so far in the note of the single-server queue.

From the gure is evident

ˆ
 
t P (t) L(t) 
1  X Si2 X Ti2 

1
R̄ = lim r(τ )dτ = lim + Ti Si +
t→∞ t 0 t→∞ t 2 2
i=1 i=1

and as usual

P (t) L(t) 
1 X Si2 T2

P (t) L(t) 1 X
= lim · + · Ti Si + i
t→∞ t P (t) i=1 2 t L(t) i=1 2

λS¯2 T¯2
 
= + λB S̄ T̄ + .
2 2
Where T̄ is the average warm up time. The only thing to discover here is λB .

Evaluation of λB As what stated so far in the note about the single server queue

1
λB =
B̄ + I¯
and


= P {Q(t) > 0} = 1 − πo
B̄ + I¯
where π0 = P {Q(t) = 0}.
Thus, always from the knowledge we have already on the M/M/1

ρ 1 − π0 ¯
B̄ = · I¯ = ·I
1−ρ π0
thus

I¯ I¯
 
1 1 π0
B̄ = − 1 I¯ ⇒ B̄ + I¯ = ⇒ = ⇒ λB = ¯ .
π0 π0 λB π0 I
1
Remembering that because of Poisson arrival it's valid ¯
I
= λ, hence

λB = π0 λ.

The only unknown now is π0 .

Evaluation of π0 The average eective service time is (by the total probability theorem):

S̄ˆ = S̄(1 − π0 ) + (S̄ + T̄ )π0 = S̄ + T̄ π0 (1).

32
That means that the average eective service time is S if the arrival nds the server busy or is S+T if the

arrival nds the server idle. Indeed, by PASTA property, π0 is the probability that any arrival nds the server idle.

Furthermore applying Little's the eective utilization fraction is

ρ̂ = 1 − π0 = λ · S̄ˆ (2).

From (1) and (2)

1 − π0 = λ · (S̄ + T̄ π0 )

1 − λS̄ 1−ρ
⇒ π0 = =
1 + λT̄ 1 + λT̄
So, nally

L(t) λ(1 − ρ)
lim = λB =
t→∞ t 1 + λT̄
Then is trivial to prove that

R̄ λS¯2 2ρT̄ + λT¯2


W̄ = = + 
1−ρ 2(1 − ρ) 2(1 + λT̄ )
and

λS¯2 2T̄ + λT¯2


 
T̄s = W̄ + S̄ˆ = S̄ + + 
2(1 − ρ) 2(1 + λT̄ )

33
4 Shared medium networks: performance analysis

4.1 Ideal Controller

Figure 38:

Accounting these hypotheses

Hp1 N nodes with innite buer

Hp2 Poisson arrivals (λ)

Hp3 Fixed size packets (P bit/pck)

Hp4 Channel capacity (data-rate) of R bit/sec

Hp5 the ideal controller controls and coordinates perfectly the accesses to the channel (server). The network can

be modeled as a single server queue with an arrival rate N λ, an innite buer and a deterministic service
P
time. S= R , Dp .

Figure 39:

4.1.1 Ideal average delay time


The average delay of the system is

(N λ) · S¯2
D̄ideal = S̄ + W̄ = S̄ +
2(1 − ρ)
that's simply the Pollaczek-Khinchin applied at the queue with Nλ arrival rate.

34
In the case of an ideal controller the service time is deterministic

S̄ = S = Dp and S¯2 = Dp2 and ρ = N λDp

thus

 
ρ
D̄ideal = Dp 1 + [sec] (Ideal controller delay).
2(1 − ρ)
The normalized (with respect to packet time) delay time is

ρ
D̂ideal = 1 + [pcks] (Ideal controller normalized delay).
2(1 − ρ)
ρ
This physically means that the packet spend one packet-time at the server and
2(1−ρ) packet-times waiting in
the buer.

4.1.2 Ideal network throughput


The aggregate network throughputs is the average number of useful bits/sec outgoing from the network, thus

Saggragate = [F raction of time with usef ul bits] · R [sec]

The normalized throughput is then dened as

Saggragate
S= .
R
With the ideal controller all bits are useful then

S = ρ (Ideal controller normalized throughput)

Note The relation S=ρ is valid for any controller that avoids collisions (those which generates no useful bits).

For those controllers the relation becomes

S = ρ · Psuccess < ρ

where Psuccess is the probability that a packet is successfully transmitted (without collisions).

4.1.3 Ideal performance graph


ρ
In the picture is depict the typical performance graph of an ideal controller (from D̂ideal = 1 + 2(1−ρ) ).
This is the best performance we can obtain from a sharing medium network. Indeed it's a lower-bound for every

other non-ideal management policy.

4.2 Static sharing4 : TDMA


In a TDMA every node has a time slot as it follows

Note that every node has the right to its own time both if does have or does not have packets to be sent on the

shared medium.
4 In this case the medium is somehow divided in order to permit every client to access to it. Examples are TDMA (Time Division
Multiple Access) and FDMA (Frequency Division Multiple Access).

35
Figure 40:

Figure 41:

4.2.1 Average delay time


The queue can be modeled as it follows

The networks are similar to a M/D/1 with deterministic service time S = TF . Thus the waiting time, as usual,

is


W̄ =
1−ρ
and, as usual, the residual time is what has to be evaluated.

In this case the residual time is

ˆ ˆ TF2
 
t (periodicity)
1 1 2 TF M · Dp
R̄ = lim r(τ )dτ = r(τ )dτ = = =
t→∞ t 0 TF TF TF 2 2

Thus the average waiting time is

36
Figure 42:

Figure 43:

R̄ M · DP
W̄ = =
1−ρ 2(1 − ρ)
and the average delay time

M · DP
D̄T DM A = Dp + W̄ = Dp + [sec] (delay with T DM A)
2(1 − ρ)

D̄T DM A M
D̂T DM A = =1+ (normalized delay with T DM A).
Dp 2(1 − ρ)

4.2.2 Throughput
M
TDMA policy avoids collision, hence is valid ST DM A = ρ ⇒ D̂T DM A = 1 + 2(1−T ) .

4.2.3 Performance graph


The performance graph is the following

The performance seems to be almost ideal for high load (i.e. the saturation throughput is 1 for both ideal and

TDMA). On the other hand the performance is very poor for low load. This is because of the rigid allocation policy

adopted.

In any case the performance moves above the ideal controller performance.

37
Figure 44:

4.3 Static sharing: FDMA


4.3.1 Average delay time
4.3.2 Throughput
4.3.3 Performance graph
4.4 Aloha

Figure 45:

In the Aloha protocol when a packet has to be transmitted its just transmitted on the channel. If there is a

collision the packet is transmitted after a stochastic amount time, said back-o.

This protocol does not avoid collisions (i.e. S < ρ).


Suppose to have innite nodes with an aggregate arrival rate of λ and a deterministic service time Dp (i.e. xed

size and data rate R).


Dene Λ , average number of tried transmissions per secons. This rate will be greater than λ because of

re-transmissions: Λ > λ.

38
Figure 46:

4.4.1 Throughput
The load at the channel is ρ = ΛS̄ = ΛDp .
The normalized throughput is S = ρ · Psucc , where Psucc = {0 arrivals in 2Dp } as it follows

Figure 47:

If the tried transmission is still Poisson, then Psucc = e−Λ·2Dp = e−2ρ .


The normalized throughput is

SALOHA = ρe−2ρ .

Note (Slotted aloha) A special case of Aloha protocol is the Slotted aloha. The packets are sent only in slots

of dimension Dp . In this case the throughput achieve better performances, because of the vulnerability period is

just Dp .
Trivial is to nd that SSLOT T ED−ALOHA = ρe−ρ .

39
Figure 48:

4.4.2 Average delay time


S 1 ρ
If Psucc =
ρ , then the number of trials are a geometric random variable with average E[trials] = Psucc = S = e2ρ .

Thus the average number of trials without success is e − 1.
Dene B̄ = average back − of f delay .
The average delay time per packet is then


 Dp without collision
Dpacket = .
 D +B with collision
p

Finally

D̄ALOHA = Dp · 1 + (e2ρ − 1)(Dp + B̄) [sec] (delay with Aloha)


D̂ALOHA = 1 + (e2ρ − 1)(1 + ) (normalized delay with Aloha).
Dp

4.4.3 Performance graph


Drawing D(ρ) and S(ρ) on the graph:

It's possible to vary dynamically the back-o B in order to avoid the breakdown of S after the maximum
1
(S = ' 0.18). To do that is necessary to have a back-log estimation (the knowledge of clients that will try to
2e
send again, called also looser estimation).

4.5 Shared medium network in brief


For shared medium networks a trade-o has to be found. The policies that oer a controlled access have an high

delays for low load and low delays for high load. Vice versa the policies that oer a random access.

4.6 The trac light


The arrival rate in each direction of the the trac light is λ. Where λ/3 go straight (S), λ/3 do a long turn (LT)

and λ/3 do a short turn (ST). They are considered fully separated queues.

The service time is dierent for cars that turns (D ) and cars that go straight (D/2).

40
Figure 49:

The trac light policy is the following

Short turns are served twice with respect to the other actions. n is the number of cars that are able to turn

when is green.

4.6.1 Deterministic service time approximation


The three queues are the same for each side of the trac light: hence they are analyzed separately.

The service times can be approximated as deterministic as it follows


 S = (n services every 4nD secs) = 4D
 LT


SS = (2n services every 4nD secs) = 2D



 S = (n services every 2nD secs) = 2D
ST

Thus the bottle neck of the system are the long turns. The stability condition is given by

 
λ 3 arrivals
· 4D < 1 ⇒ λM AX = .
3 4D sec
Note that the assumption ≈ M/D/1 is valid only for high loads, otherwise the service time is over-rated (this is

a complex batch service system).

4.6.2 Short turn


A test client arrives on the short turn queue. The waiting time is

W̄ST = R̄ + N̄FST S̄ST

From Little's N̄FST = λ3 S̄ST , then


⇒ W̄ST = .
1 − λ3 S̄ST

The only unknown here is R̄. The residual time r(t) is the following

41
Figure 50:

The r(t) is periodic. In the rst two slots short turns are not served. In the last two slots the system is supposed

to be high load. The average is evaluated on a period:

ˆ
 
(2nD)2 D2
1 2 + 2n 2 2n + 1
R̄ = r(t)dt = = D
T T 4nD 4
Hence

(2n + 1)D
W̄ST =
4 1 − λ3 2D


" #
2n + 1
⇒ D̄ST = W̄ST +D =D 1+ (1) 
4 1 − λ3 2D


4.6.3 Straight
As so far

42
Figure 51:

W̄S = R̄ + N̄FS S̄S

hence


W¯S = .
1 − λ3 2D
In this case the residual time is the following

The r(t) is periodic. In the rst three slots short turns are not served. In the last slot the system is supposed

to be high load. The average is evaluated on a period:

(3nD)2 D 2
+ 2n
  
2 2 2 9n 1 D
R̄ = = + ·
4nD 4 2 8
" #
1 (9n + 21 )
⇒ D̄S = D + (2) 
2 8 1 − 23 λD


4.6.4 Long turn


As so far

W̄LT = R̄ + N̄FLT S̄LT

hence


W¯LT = .
1 − λ3 4D
In this case the residual time is the following

43
Figure 52:

Figure 53:

The r(t) is periodic. In the rst three slots short turns are not served. In the last slot the system is supposed

to be high load. The average is evaluated on a period:

(3nD)2 2
+ n D2
 
2 9n D
R̄ = = +1 ·
4nD 4 8
" #
1 (9n + 1)
⇒ D̄LT =D + (3) 
2 8 1 − 43 λD


4.6.5 Conclusions

 D̂ST = D̄DST ' 1 + 4 1−2nλ 2D
( 3 )




D̄S
D̂S = D ' 2 + 8 1−9n2 λD
1
f or n  1 

 ( 3 )
D̄ 9n

D ' 1 + 8(1− 4 λD )
 D̂LT =
 LT

44
Figure 54:

Figure 55:

4.7 Ethernet
Suppose that every node in a ethernet network has always packets to transmit (high load). The channel behaves in

time as it follows

The Busy-Idle cycle is a succession of

• Contention intervals {Ii };

• Transmission intervals {Bi }.

For sake of simplicity the contention intervals are a sequence of contention slot. A contention slot has a xed size

of a round-trip time, 2τ 5 .
Ethernet has a shared medium. The access mechanism is supposed to be the following: if a node has to transmit

something on the channel it rst sample it. If it is free then the node tries to start the transmission with probability

q, otherwise no. The trials are repeated at each contention slot (back-o algorithm). When a node is the only one

trying to transmit in a contention slot the communication starts until the node ended to transmit its packet.

If there are N nodes, all trying contending the channel, the probability to transmit on the channel is

P {only one node tryes to transmit on the channel} = A = N · (1 − q)N −1 q (1)

Maximum probability of transmission A is maximized when the probability q= 1


N . Thus

1 N −1
AM AX = (1 − ) .
N
1 N −1 1
Moreover AM AX is lower bounded. Indeed limN →∞ (1 − N) = e ' 0.36. Thus AM AX > 1e .
5 τ is the propagation delay between the two farthest node in the network.

45
Figure 56:

Figure 57:

Length of a contention interval The probability that a contention period is long j slots, with A = AM AX , is

P {I = j} = (1 − AM AX )j AM AX j = 0, 1, 2, ... (geometric).

Thus the average length of a contention period is

(1 − AM AX )
I¯ = . e [slots]
AM AX

I¯ . 2eτ [secs] (2)

Length of a packet Usually packet size is variable. The average transmission time is


D̄p = [secs]
R

4.7.1 Saturation throughput


With the average length of a contention interval and the average length of a transmission interval the throughput

is trivial to be evaluated:

46
Figure 58:

Figure 59:

D̄p D̄p
SM AX = ¯ & (3)
D̄p + I D̄p + 2eτ
(2)

Note If 2τ  D̄p ⇒ T → 0. Thus ethernet works well only if the packet duration is longer than the propagation

delay.

4.7.2 Example (typical ethernet saturation throughput)

Figure 60:

Ethernet standard (IEEE 802.3) requires that the distance between two node at most 2.5 km. Moreover, the

maximum numbers of repeaters between two nodes is xed to 4.


The maximum round-trip time is 2τ < 21.2 µs. Transmitting at R = 10 M bps this means 512 bit (or 64 byte),
that is the minimum length of a ethernet packet (called frame). This is the minimum length necessary to reveal

collisions during contention slots.


64
Transmitting with frames of 64 byte the packet duration is D̄P = 2τ = R s the throughput is

64
R 1
TM & 64 64 = = 0.26.
R + Re
1+e
(3)

47
Transmitting with frames of 1024 byte (usual dimension) the throughput is

1024
R
TM & 1024 64 = 0.85.
R + Re
(3)
That is the typical ethernet saturation throughput. Every node can transmit at 10 M bps, but the useful bits

transmitted are only 8.5 M bps.

4.8 Token-ring

Figure 61:

The network is a ring with a direction. In the gure every node has the right to use the network after its left

neighbor and before its right neighbor. The cyclic mechanism is realized using a token.

Said l the distance between two nodes, L the total length of the ring, v the propagation speed and D̄p the

average packet duration. The average cycle duration is

C̄ = D̄p + L + l
v v
token recircle token passage

4.8.1 Saturation throughput


In a token-ring network the throughput is

D̄p
TM = (L+l)
.
D̄p + v

A typical throughput for a token-ring network is SM = 0.95.


L
In this kind of networks are used long size packets (about 17 Kbyte) or packet sequences. Indeed, if
v  D̄p ⇒
S → 0, leading to ineciency.

4.9 Polling Systems


Suppose to have a network with N nodes.

48
Figure 62:

Figure 63:

Service times {Si } are the same for every node and they are independent from arrivals. S̄ , S¯2 are known.

Nodes transmit the rst packet of the queue when asked (this is called limited service).

There is a stochastic reservation interval between two consecutive interrogations. Reservation intervals {Vi } are

IID. V̄ and V¯2 are known.

Little's at the server is

ρ = N λS̄

that is the utilization fraction of the server (fraction of time in which the server is busy).

The server can be seen as a single queue. The average waiting time W̄ of a packet can be evaluated with a test

packet arriving on a generic queue (say the rst one, because they are all equals).

The waiting time is given by:

• the residual time of the client served when the test packet arrives (R̄);

• the service times of the NF packets arrived before the test packed;

• the reservation times before the NF packet transmissions.

49
Figure 64:

Thus, the average waiting time is

W̄ = R̄ + N̄F S̄ + Ȳ (1)
PL
where Y = i=1 Vi .

Residual time As so far evaluated in the M/G/1 with vacations

N λS¯2 (1 − ρ)V¯2 S̄ρ(1 + CV2S ) 1−ρ


R̄ = + = + V̄ (1 + CV2V ) (2)
2 2V̄ 2 2
Note that in the residual time is accounted also the possibility that the test packet arrives during the reservation

interval.

Evaluation of N̄F Little's to the system gives the average number of clients in the system

ρ
N̄F = N λ · W̄ = W̄ .

Thus, by equation (1)

W̄ (1 − ρ) = R̄ + Ȳ (3)

where ρ = λN S̄ .

50
Figure 65:

Figure 66:

Figure 67:

Evaluation of Ȳ
L
X
Y = Vi → Ȳ = L̄ · V̄
i=1
stoch. sum
ρ
The test packet arrives with uniform probability on the timeline. With probability
N it arrives during the
1−ρ
transmission of a node. With probability
N it arrives during the reservation of a node. Thus with probability
ρ 1−ρ 1
N + N = N it arrives during a reserved slot of a node.
N̄F
Let's say NF1 the number of clients before the test. Because of the queues are all the same, N̄F1 = N .
If the test client arrives with its queue empty (NF1 = 0), then

Probability Event Length

1
If it arrives during N-th slot 1
N
1
If it arrives during (N-1)-th slot 2
N
... ... ...
ρ
If it arrives during 1-st slot, service time N
N
1−ρ
If it arrives during 1-st slot, reservation time 0
N
Therefore

1 1 ρ 1−ρ 1 (N − 1)N N −1
E[L|NF1 = 0] = 1 · +2· + ... + 1 · +0· = +ρ= +ρ
N N N N N 2 2
TP

51
Figure 68:

Figure 69:

If the test client arrives when its queue is not empty it sees NF1 extra cycles. Thus NF1 · N reservation intervals.

Hence

N −1
E[L|NF1 > 0] = + ρ + E[NF1 · N |NF1 > 0]
2
Finally

 
N −1
L̄ = E[L] = + ρ [P {NF1 > 0} + P {NF1 = 0}] + N · E[NF1 |NF1 > 0]P {NF1 > 0}
2
TP

N −1
L̄ = + ρ + N̄F (4)
2
Collecting all the results (1)-(4)

 
S̄ρ(1 + CV2S ) 1−ρ 2
N −1
W̄ (1 − ρ) = + V̄ (1 + CVV ) + V̄ + ρ + N̄F
2 2
| {z 2 } | {z }
R̄ L̄

52
 
S̄ρ(1 + CV2S ) + V̄ N + ρ + (1 − ρ)CV2V
W̄ =   
2 1 − ρ 1 + V̄S̄

Considering the throughput T = ρ, fraction of tim in which packets are sent and the delay of the polling system

D̄polling = W̄ + S̄ . Thus

T (1 + CV2S ) N + ρ(1 − ρ)CV2V


D̄polling 1 + 1
D̂polling = = T
2(1 − TM AX ) + ( − 1)
S̄ | {z }
SM AX 2(1 − TMTAX )
≈ M/G/1

where SM AX = S̄+V̄
. It's trivial that for stability (D̂polling < ∞) it has to be S < SM AX .

4.9.1 Comparisons with ideal controller


In order to compare the polling network with the ideal one and TDMA suppose that S = DP and V are deterministic.

Thus

 
1
ρ+ SM AX − 1 (N + S)
D̂polling = 1 +  
2 1 − SMTAX
Dp
with SM AX = Dp +V .    
1 N V N
Thus S → 0 ⇒ D̂polling → 1 + SM AX −1 2 =1+ Dp 2.

Figure 70:

Note that if V  Dp the polling system is really close to the ideal controller. The delay at low load is similar

to the ideal and SM AX → 1.

53
4.9.2 Exercise (proofs on polling system)
Prove that in the polling system

N V̄
1. The average cycle duration is C̄ = 1−ρ .

ρ V̄
2. The average number of trials in a cycle is N̄C = 1−ρ ·N · S̄
.

ρ V̄
3. The probability that the test packet nds the queue not empty is P {NF1 > 0} = 1−ρ · S̄
.

5 Mesh networks: performance analysis

Figure 71:

Consider a network with N nodes. Every node has an input with rate λij [pck/sec]. i means that is an input

rate and j means that is for the j − th node.

Dene L̄ [bit] the average length of a packet.

Dene Ckj [bit/sec] is the average transmission rate on the k→j channel.

Dene λkj [pck/sec] the average arrival rate on the k→j link.

Dene Q̄kj [pck] the average number of packets in the k→j queue.
PN i
Moreover dene Λ, j=1 λj the total input rate for the whole network.
Applying Little's to the whole network

Q̄ 1 X
D̄ = = Q̄kj (1)
Λ Λ
(k,j)

Suppose that the ows are split in the network internal queues in order to guarantee stability for all of them.

5.1 Kleinrock's hypothesis and routing


All the queues in the mesh network are M/M/1. They are independent one from each other.

Kleinrock's hypothesis is introduced for sake of simplicity.

The utilization fraction (or the load) in this case is

54
Figure 72:

L̄ Fkj
ρkj = λkj S̄kj = λkj · ,
Ckj Ckj
Where Fkj [bit/sec] is called the ow at the input of the queue k → j.
ρ
Recalling the M/M/1 result that states Q̄ = 1−ρ , the average, thus

Fkj
Q̄kj = (2)
Ckj − Fkj
Hence, substituting in (1)

1 X Fkj
D̄ = (3)
Λ Ckj − Fkj
(k,j)

This is the basic formula for rough routing planning of packets network in order to have stable networks. Thus

the stability is given by Fkj < Ckj .

5.1.1 Example (rough routing of a mesh network)


Given
1. Input ows arrival rates {λij };
2. The transmission capacities {Ckj }
If the network topology is known it's possible to nd the optimal routing that minimize the delay of the whole network
D̄.
The minimization should be done with respect to the following constraints

 Fkj ≥ 0 non − negative f lows
 F <C stable queues
kj kj

This is a typical constraint minimization problem of a function (D̄) with constraint unknowns (Fkj ). In operative
research are studied problems like this one.

Numerical example Given


• C12 = C23 = 2 [kb/s]

• C13 = 1 [kb/s]

• L̄ = 1 [kb/pck]

55
Figure 73:

• λi12 = λi13 = λi23 = 1 [pck/s]

From the gure is evident that λi2 = λi23 and λi1 = λi12 + λi13 .

Solution The routing optimization should work this way

1. First try to route the most of the trac through the shortest path.

2. What has not be routed before has to be optimized.

Thus, all the trac of the ow λi12 can be sent through
1
1 → 2. F12 = λi12 L̄ = 1 ≤ C12 [kb/s].
Likewise λi23 goes through 2 → 3.
i i
Dierently λ13 cannot be all routed on 1 → 3, because F13 = 1 = C13 [kb/s]. The queue will be not stable

because ρ = 1.
The solution is to route a part of the ow, β, through 1→3 and another part, 1 − β, through 1 → 2 → 3, like

it follows


 βλi13 1→3
 (1 − β)λi 1→2→3
13

To optimize β is used (3)

 
1 F12 F13 F23
D̄ = + +
Λ C12 − F12 C13 − F13 C23 − F23
(3)
with

 


 F12 = λi12 + (1 − β)λi13 L̄ = 1 + (1 − β)


F13 = βλi13 L̄

 =β



 F23 = λi23 + (1 − β)λi13 L̄ = 1 + (1 − β)



 Λ=1+1+1 =3

hence

 
1 1 + (1 − β) β
D̄ = 2· + .
3 1 − (1 − β) 1 − β

56
The optimal routing is the one that minimize D̄. Then

∂ D̄
D minimum ⇒ =0 ⇒ β = 0.66 
∂β
some math

5.2 Number of hops impact on the network


In this section some simplied relations between the number of hops and network performance indices are found

(throughput and network delay).

Consider a network built with N identical nodes.

Figure 74:

The trac in the network is uniform. Every node transmit with equal probability to every other node. The

input rate, λi , is the same for every node. The input and the output rate are equal, λi = λo . This trac is said to

be uniform.

Every node is connected to others p nodes via unidirectional links. The transmission capacities of the link are

the same for every link. In every network of this kind there are p·N unidirectional links.

The number of links outgoing from a node, p, is called connection degree.

Every node in this kind of network sees the same topological situation.

Some examples of this networks are presented below.

5.2.1 Manhattan street network


Manhattan street network is a multi-ring network. Is not planar and it can be built on a donut.

5.2.2 Shuenet
Shuenet is a multi-ring network. Is not planar and it can be built on a cylinder.

57
Figure 75:

5.2.3 Throughput
All the queues are equal. Thus

Dene q̄ the average numbers of packets in a queue, d¯ the average delay of the queue, L̄ the average size of the

packets and D̄p the average transmission time of a packet (
C ).
The utilization fraction of the link is

ρ = λD̄p = λ
C
Little's law applied to the single queue is

ρC ¯
q̄ = λd¯  =  L̄ d
ρC
λ= L̄

For the whole network

Q̄ = Np · q̄

D̄ = H · d¯

where H is the average number of hops from the source to the destination. Thus Little's applied to the whole

network is

D̄ =
Λ |{z} Q̄
|{z} (1)
H d¯ Np ρ C

58
Figure 76:

Figure 77:

Note that ΛL̄ is the aggregate throughput of the whole network. Thus, the normalized throughput T is

ΛL̄  p
S= = ΛD̄p = N ρ (2)
C H
(1)

Where all queue are identical and stable (ρ < 0).


Despite the fact that in avoiding collisions shared link networks the throughput is S = ρ, in these kind of
N ·p
networks the throughput is S= H ρ and not S = N · p · ρ. This is because the packets that do hops perturbate

the packets that do only one hop.

Evident is that the average number of hops H has to be minimized to maximize the throughput S. This routing

is called shortest-hop.

As so far, the saturation throughput SM AX is given when ρ → 0, thus

59
Figure 78:

N ·p
SM AX =
H
To improve the capacity of a network (how many useful b/s does the network can eort? SM AX C )

• Increase C: with fasters transmitters we can improve the number of useful bit per second the network can

eort. Like using optical bers instead of copper line.

• Increase p: high meshing networks are more ecient

• Reduce H: choose a routing algorithm able to reduce the average number of hops.

5.2.4 Delay time


If the networks are all M/M/1 the delay is

H · D̄p
D̄ = H · d¯ =
1−ρ
Where H · d¯ is the time requested to do H hops. Thus, the normalized delay

D̄ H
D̂ = =
D̄p 1−ρ

5.2.5 Performance graph


H
From D̂ = 1−ρ and T = TM AX ρ

5.3 The Moore bound


The saturation throughput of a p-connected network is

SM AX p
= .
N H
The question is how the topology inuence the throughput?

Indeed Manhattan, Shuenet and Bidirectional Ring networks are all 2-connected networks. If all the links cost

the same a question could be: which topology is capable to minimize the average number of hops H? There is a

lower bound: the Moore bound.

The Moore bound is achieved by the Moore network and is

dX
M AX  
n(i)
Hmin = i·
i=1
N −1

60
Figure 79:

1
where dmax is the diameter of the network, n(i) is the number of nodes i-hops away from S and
N −1 is the
probability of transmitting to an i-hops away node with uniform trac.

The Moore network is that theoretical network where every node sees a p-ary tree topology. This network is

the most compact p-connected network, thus the one that minimize H.
In a Moore network is valid the following

X−1
dmax dX
max

pk ≤ N ≤ pk
k=0 k=0

pdmax − 1 pdmax +1 − 1
≤N ≤
p−1 p−1

⇒ dmax = blogp ((p − 1)N + 1)c

From this

1
dX
max
1 X−1
dmax 
p dmax
− 1
!
H = k · n(k) = k · pk + dmax N −
N −1 N −1 p−1
(M oore) k=0 k=0

dmax pdmax p(pdmax − 1) pdmax − 1


  
1
= − + dmax N −
N −1 p−1 (p − 1)2 p−1

max → logp N + logp (p − 1) = logp (N · (p − 1))
 d
N big enough ⇒
p
 H → logp [N (p − 1)] − (p−1)

61
Figure 80:

5.4 The roundabout


Suppose that

1. Poisson arrivals with rate λi ;

2. Uniform trac is arriving a the round about.

3. Precedence is given to the trac in the roundabout

4. Roundabout is given in W =4 slots. The time spent to cross the slot is Dp .

Find the average delay time D̂ in function of the throughput λi .


Note that increasing the number of slots (W > 4) the throughput remains the same, the delay will increase.

In this example is studied the p=1 and p=2 lanes in the roundabout.

5.4.1 Network model of a roundabout


The roundabout can be modeled in a ring network as it follows

If p = 2, then two vehicles can exit simultaneously from an exit.


N
In the model there are 4 nodes. The average number of hops (with uniform trac) will be H= 2 = 2.

62
Figure 81:

5.4.2 Throughput S

The normalized throughput is given applying Little's to the dashed box

Np
S= · ρ (A)
H
where ρ is the utilization fraction of the links (internal).

Furthermore

 

S= Λ· = Λ · Dp (B)
C
That is the average number of arrival in a client transmission time.

From (A) and (B)

Np H i 
ρ = N λi Dp ⇒ ρ = λ Dp (1)
H p
Suppose that the roundabout is a slotted ring. If this is true then ρ = P {f ull slot}.
The ow balance at the node is showed in the following gure.
S
The node throughput is given by Sn = N . It coincides with the average number of clients injected/absorbed
per node in Dp . Further

p
Sn = Sinj = Sabs = λi Dp = ρ (2)
H
Now we go further in the injection and absorption throughputs investigation.

Absorption Sabs Said r = {a client has our slot as destination}, then

Sabs = ρ · r · p (3)

where ρ is the probability that a slot is full and r is the probability this slot is the destination.

Sabs is the average number of clients absorbed (exiting from the roundabout) per slot per node, thus the

probability of absorption.

63
Figure 82:

From (3) and (2), then

1
r= (4)
H
that means physically that there will be an absorption every H hops on average.

Injection Sinj For the injection, Sinj is the average number of client injected per slot per node, thus the probability

of injection. Specically

Sinj = P {at least 1 client in the queue} · P {successf ul injection} = g · Ps

Here there is the evaluation of Ps , g will be evaluated later on.

 p
(1 − r) p 1
Ps = 1 − ρ · − · −
|{z} |{z} ( |{z} |{z} | {z } ) = 1 ρ (1
H
) (5)
always but f ull slot and not absorbed

5.4.3 Service time S̄

The service time of the network is

Ns
X
S= Dp = Ns S (6)
j=1

64
Figure 83:

where Ns is the number of slots needed to to inject a car in the the roundabout.

Ns has the following PMF

P {Ns = n} = (1 − Ps )n−1 · Ps n = 1, 2, 3, ... (geometric)

thus N̄s = 1
Ps and N¯s2 = 2−Ps
Ps2 , then

Dp 2 − Ps
S̄ = and S¯2 = Dp2 (7)
Ps Ps2
D D
Thus by Little's law: P {empty queue} = 1 − λi S̄ = 1 − λi Psp ⇒ P {at 1 client in the queue} = g = λi Psp . Thus

expression of g is found.

5.4.4 Waiting time W̄


To nd the waiting time see that the queue is a M/G/1. The W̄ was calculated so far and it is

λi S¯2 λi Dp · 2−P
Ps2
s

W̄ = = Dp  
2(1 − λi S̄) P −λi D
2 · s Ps p
(7)

Dene X , λi Dp .
H
From (1) ⇒ ρ = p X.  p  p
H 1 H−1

From (5) ⇒ Ps = 1 − p 1− H X =1− p X .

Thus

 
2
X 1− H−1 p − 1
( p X)
W̄ = Dp ·   p 
2 1 − X − H−1p X
  p 
H−1
The rst denominator that goes to zero (thus the one that cause instability) is 1−X − p X , then

65
Figure 84:

1
p = 1 → 1 − 2X = 0 ⇒ X = = 0.5
2

X 2 √
p=2→1−X −( ) = 0 ⇒ X = 2( 2 − 1) ' 0.82
2
Hence, the normalized saturation throughput

0.5
p = 1 ⇒ λiM AX =
DP

0.85
p = 2 ⇒ λiM AX '
DP

5.4.5 Network delay D̄


Given the waiting time is trivial to evaluate the delay of the network

D̄ = W̄ + H · Dp − Dp + S̄
| {z } |{z}
propagation Injection

66
hence, normalizing

D̄ W̄ S̄
D̂ = = +H −1+
Dp Dp Dp

For X → 0 ⇒ D̂ = H , thus if the load tends to go to zero, then the delay time is just the time to do the hops.

5.4.6 Performance graph

Figure 85:

Note that with uniform trac all the streets are equal at the roundabout (unfair), when on the trac light is

possible to serve better the street with high trac (fair).

6 Discrete Time Markov Chains (DTMC)

6.1 DTMC denitions and properties


Let's consider a sequence (or chain) of random variables X1 , X2 , ..., Xn , ..., that describe a discrete-time stochastic

process {Xn , nN}.


Suppose the process {Xn } assumes only values belonging to a set S = {s1 , s2 , ...}, nite or innite countable.

The elements of this set are called states of the process.

Thus the process can be represented as the following

Denition (DTMC) {Xn , n = 0, 1, 2, ..} is a Discrete Time Markov Chain (DTMC) if

P {Xn = in |X0 = i0 , X1 = i1 , ..., Xn−1 = in−1 } = P {Xn = in |Xn−1 = in−1 } (1)

∀n = 1, 2, ... and ∀i0 , i1 , ...N

The DTMC is said to be nite if the number of the states is nite, |S| < ∞.

67
Figure 86:

(1) is called the Markov memoryless property. In common words, in a Markov process, the future behavior given

the past and the present, depends only on the present. Thus the Markov process in independent from the past,
6
given the present .

Figure 87:

Denition (time-homogenous DTMC) Suppose that {Xn } is a DTMC. If ∀i, j S the 1-step transition prob-

abilities don't depend on time n, then the DTMC is said to be time-homogeneous.

P {Xn = i|Xn−1 = j} , pij (n) = pij


Denition (1-step transition matrix) P = {pij } is said to be the 1-step transition matrix, thus

 
p00 p01 ...
P =  p10 p11 ... 
 

... ... ...


For this matrix is valid the following


 pji ≥ 0
(2)
P|S|
i=0 pij = 1

Every element of the matrix is a probability and the columns sum to one. Because of those properties the matrix

is said to be stochastic or Markov. The column of the matrix are a PMF.

Instance (arrival/departure times)


Pn
The process Sn = i=1 Xi with {Xi } i.i.d. (renewal instants) is a DTMC.

6 In probability a random variable A is said to be independent from B if and only if P (A|B) = P (AB) = P (A)
P (B)

68
Pn
The process can be written as Sn = i=1 Xi = Sn−1 + Xn , thus if sn−1 is known the PMF doesn't depend from

the past. The Markov property is satised.

Instance (increments process) The process Yn = Xn − Xn−1 with {Xi } i.i.d. is not a DTMC.

Indeed

Xn = Yn + Xn−1 = Yn + Yn−1 + Xn−2 = (Yn + ... + Y1 ) + X0

⇒ Yn = Xn − Yn−1 − Yn−2 − ... − X0

Thus the PMF depends on the present and on the past. The Markov property is not satised.

6.1.1 Probability of a path


Thanks to the chain-rule is trivial to nd a probability of a path in a markov chain.

P {X0 = i0 , X1 = i1 , ..., Xn = in } = P {X0 = i0 } · P {X1 = i1 |X0 = i0 } · ... · P {Xn = in |Xn−1 = in−1 } =

n
X
= P {X0 = 10 }p10 p21 = pj,j−1 · P {X0 = i0 }
j=1 | {z }
| {z } start prob.
1 − step prob.

6.1.2 PMF at the n-th step


The PMF of the random variable Xn is P {Xn = i} , pi (n). Those probabilities can be collected in a state vector

 
p1 (n)
p(n) =  p2 (n)  (state vector)
 

...

p(n) is wrongly said distribution at time n. This is the rst order statistic of the stochastic process {Xn }.
The distribution at time n can be found as it follows

X
pi (n) = P {Xn = i|Xn−1 = j}pj (n − 1) ∀iS (3)
jS
(T P )
In matrix form

p(n) = P(n)p(n − 1)

Hence, if p(0) is the initial distribution of the DTMC, recursively is trivial to obtain

p(n) = P(n)P(n − 1) · ... · p(0)

For a homogeneous DTMC it simplies to

69
p(n) = Pn · p(0)

6.2 DTMC as a LTI system


What is stated so far means that the update law of the PMF of the process {Xn } is the same as a linear time-

invariant system with system matrix P. The time evolution of the PMF, p(n), is the response of the system to the

initial state p(0). The time evolution is related to the eigenvalues {λi } of the matrix P.

6.2.1 BIBO stability


Because of |p(n)| = 1 the system is bounded-input bounded-output (BIBO) stable. All the eigenvalues will have a

magnitude less than one: |λi | 6 1 ∀i.

6.2.2 The stationary distribution


hP P i
A Markov/stochastic matrix has always eigenvalue λ = 1. Indeed, if e = [1, 1, ..., 1], then e·P = j p1j , j p2j , ... =
[1, 1, ..., 1] = e.
Thus, e is a left eigenvector of P. But left and right eigenvalues coincide, thus exists an eigenvector z ⇒ Pz = z.
If |z| = 1, then z is a PMF and is called stationary distribution. If the starting distribution is p(0) = z then the

process {Xn } is stationary: p(n) = z ∀n.

6.2.3 Example (the limiting distribution in a slotted source)


A slotted source works this way:
• if at time n is idle then at time n + 1 it will be idle again with probability 1 − α;
• if at time n is busy then at time n + 1 it will be busy again with probability 1 − β .
A realization of the behavior of the source can be the following

Figure 88:

Evaluate the time evolution of the PMF of the process {Xn }.

Solution Represent the process with two states: 0 (idle) and 1 (busy).

The process has the following behavior


 P {X = 0|X
n n−1 = 0} = 1 − α
 P {X = 1|X
n n−1 = 1} = 1 − β

thus the future is independent from the past given the present: it's a DTMC.

The DTMC is represented in the following state diagram

70
Figure 89:

F rom
z
(" }| #{
P = To 1−α β
α 1−β

The probabilities not specied in the text of the example are found knowing the the columns are PMFs. The

process is time-homogeneous (P = P(n)), thus

p(n) = Pn · p(0) (update law)

Let's see how the transition matrix evolves (reference values α = 0.1 and β = 0.2)
" # " #
2 0.9 0.2 0.83 0.34
P = =
0.1 0.8 0.17 0.66
" #
2 2 0.74 0.50
P4 = P

=
0.25 0.49
" #
8 0.68 0.62
P =
0.31 0.37
" #
16 0.66 0.66
P =
0.33 0.33

the limit results to be


7

" #
2/3 2/3
lim Pn = (nth step matrix)
n→∞ 1/3 1/3

The columns of the matrix are exactly the same. For all possible starting distribution then
8

" #" # " # " #


n 2/3 2/3 p0 (0) 2/3 P {Xn = 0}
w = lim P = = = lim (Limiting distribution)
n→∞ 1/3 1/3 p1 (1) 1/3 n→∞ P {Xn = 1}

The limiting distribution (i.e. the probability of nd the system busy or idle) is the same for all the possible
   
7 Generally is proven that Pn = 1 β β (1−(α+β))n α −β
+ n ≥ 1.
α+β
  α α 
α+β −β
 α
8 Generally is proven: w = 1 β P {Xn = 0}
= limn→∞
α+β α P {Xn = 1}

71
starting distributions, is the distribution at which the system tend to be.

Note (relation with the renewal processes) Dene


F , (Busy f raction)
B̄ + I¯

Figure 90:

B and I are the sojourn times in the busy/idle state, thus their distributions are geometric distributions


 P {B = n} = (1 − β)n β
 P {I = n} = (1 − α)n α

Hence, by geometric distribution properties, B̄ = 1


β and I¯ = 1
α.
Finally

1
B̄ β α
F = = = ⇒ F ≡ P {Xn = 1}
B̄ + I¯ 1
α + 1
β
α+β

Thus our interpretation of F as the probability of nd the system busy at the time n was correct X.

72
6.3 The limiting distribution
The limiting distribution is really important in the study of a DTMC. In this section we discover for which DTMC

the limiting distribution w exists and is unique.

Fact There are so many linear independent stationary distributions (z = P · z) as is the multiplicity of the

eigenvalue λ=1 in the matrix P.


Every linear combination of them is a stationary distribution.

Fact If the limiting distribution exists then is a stationary distribution (w = P · w).


Dim. w = limn→∞ p(n) = limn→∞ P · p(n − 1) = P · limn→∞ p(n − 1) = P · w 

Fact There are some DTMC for which the limiting distribution doesn't exist (@w). Those DTMC are called

periodic.

There are some DTMC for which the limiting distribution exists but is dependent from the initial distribution

p(0).
Last, there are some DTMC where the limiting distribution exists and is unique. In those DTMC the matrix

T = limn→∞ Pn has all the columns equal to w.


In order to understand how a DTMC can have dierent w is necessary to study the properties of the states.

6.4 State classication


Denition (accessibility) The state i is said to be accessible from the state j if exists a path with non-zero

probability that lead from j to i in an arbitrary n number of steps. Algebraically:

(n)
j → i ⇒ Pij = P {Xn = i|X0 = j} > 0

Figure 91:

Denition (communication) The states i and j communicate if they are accessible one from each other. Alge-

braically


 P (n1 ) = P {X = i|X = j} > 0
ij n 0
i↔j⇒
 P (n2 ) = P {X = j|X = i} > 0
ji n 0

For communication is valid the symmetry (i ↔ i) and the transitivity (if i↔j and j↔k then i ↔ k ).

Denition (class) Two states are belonging to the same class if they communicate.

Two dierent classes are disjoint because if they have a common state then they will communicate.

73
Denition (irreducible DTMC) A DTMC is said to be irreducible if it has only one class.

It can be proven that for a irreducible DTMC the eigenvalue λ = 1 has multiplicity 1. Hence, exists and is

unique the stationary distribution (z = P · z).

Figure 92:

Some examples This is a DTMC with 3 classes. The state 3 is said to be absorbent.

Figure 93:

This is a DTMC with only one class, thus it is irreducible.

Figure 94:

This is an example of an innite number of state and innite number of classes DTMC. This process is called:

the counting process.

This is an example of an innite number of state DTMC with only one class. This process is periodic and is

called: the random walk process.

6.5 Recurrence: type of classes


A DTMC is starting from the j − th state (hence X0 = j ), thus

74
Figure 95:

 
0
 ... 
 
 
 1  ← j position
p(0) =  
 ... 
 

and observe the evolution of the {Xn }.

Figure 96:

Tj is said to be the recurrence time.

Each return is a renewal. For the memoryless property of the DTMC at each time the chain goes back to j the

evolution starts again with the same probabilities of the rst time. Hence {Tj (i)} are independent and identically

distributed.

Dene Ij (n) the return indicator as it follows


 1 Xn = j
Ij (n) =
 0 else
Pn
Thus the total number of returns to j at time nis R(n) = k=1 Ij (k).
The expected number of return in j at time nwill be then

75
Figure 97:

n n n
(k)
X X X
E[Rj (n)|X0 = j] = E[Ij (k)|X0 = j] = P {Xk = j|X0 = j} = Pjj
k=1 k=1 k=1

(k)
where Pjj is the probability that the process goes from j→j in k steps.

Denition (recurrent and transitory states) The state j is said to be recurrent if


(k)
X
E[Rj (∞)|X0 = j] = Pjj = ∞
k=1

(i.e. innite returns in an innite amount of time)

The state is said to be transitory if

E[Rj (∞)|X0 = j] < ∞

Figure 98:

Fact The recurrency is a class property. Indeed, if j ←→ i and j is recurrent, then i is recurrent too. Same

reasoning works for transitivity.

Hence if a DTMC is irreducible (only one class) all the states will be transitory or recurrent.

76
Moreover if the DTMC is irreducible with a nite number of states the states will be recurrent (because exists

at least an accumulation point visited innite times).

In example 2 all states are recurrent.

Denition (periodicity) The state j is said to be periodic with period d if it can be revisited only at times
(k)
multiple of d. Formally Pjj =0 if n is not a multiple of d.

Figure 99:

Fact All the states belonging to the same class have the same period.

In example 2 the states {0, 1} can be visited at times 2,4,6,.. and the states {2, 3} can be visited at times 4,6,8,..
. Hence the chain is periodic with period d = 2.
In example 4 the number of increments (+1) is equal to the number of decrements (-1). Hence the chain is

periodic with period d = 2.

Denition (aperiodicity) A irreducible DTMS is said to be aperiodic if its period is d = 1.

6.5.1 Type of recurrency

Figure 100:

As stated so far, the recurrence times Tj (i) are independent and identically distributed with average E{Tj },
that can be nite or innite.

In this game, i are the renewals and Rj (n) is the renewal counting process. Hence, by the renewal theorem, the

fraction of time spent in j on the interval [0, n] will be

77

Rj (n)  0 if j is transitory
Fj (n) = −→ πj =
n  1
if j is reccurent
n→∞ E[Tj ]

πj is the long term fraction of time spent in j by the DTMC.

Denition For a recurrent state j

• if πj > 0 the state is said to be positive recurrent

• if πj = 0 the state is said to be null recurrent.

In example 4

• if p > (1 − p) the chain drift towards +∞, hence all states are transitory.

• if p < (1 − p) the chain drift towards −∞, hence all states are transitory.

• if p = 0.5 the DTMC doesn't drift, hence null recurrent states.

Denition (ergodic state) A state is said to be ergodic if it is positive recurrent and aperiodic.

Figure 101:

Fact Positive and null recurrence are class properties.

78
Denition (ergodic chain) A DTMC is said to be ergodic if it is irreducible, positive recurrent and aperiodic.

Note that a nite and irreducible DTMC is ergodic if it's aperiodic. Then the chain in the example 2 is not

ergodic.

6.5.2 Limiting distribution in ergodic chains


Consider a irreducible (only one class) and positive recurrent DTMC.

Starting from the state j (X0 = j ) we observe the visits to a generic state i.
As always, dene the return indicator


 1 if Xn = i | X0 = j
Iij (n) =
 0 else
Pn
and the number of returns Rij (n) = k=1 Iij (k).

Figure 102:

Beside the rst interval, all the others are independent and identically distributed.

By the renewal theorem

Rij (n) 1
lim = , πi > 0
n→∞ n E[Ti ]
w.p.1
that is the long-term fraction that the DTMC spends in i, for every arbitrary starting state j.
P
It is easy to see that iS πi = 1, i.e. a π is a PMF.

proof
P
Indeed, starting from X0 = j , the chain can visit any state iS , thus in the interval [1, n] iS Rij (n) = n.
P Rij (n)
Thus, iS n =1 and limiting now to innity

Rij (n) X Rij (n) X


1 = lim = lim = πi 
n→∞ n n→∞ n
iS iS
w.p.1

Fact For a irreducible and positive recurrent DTMC it is proven that π is the only stationary distribution, i.e.
1
π = Pπ , with π= E[Ti ] , iS .

79
Fact For an ergodic DTMC (i.e. irreducible, positive recurrent and with period 1) it is proven that π is the only

limiting distribution, and it always exists.

proof The times {Ti } are random variables with integer values (because of d=1 they can assume every integer

value).

So,

n n
(k)
X X
E[Rij (n)] = E[Iij (k)] = Pij
k=1
z }| { k=1
P {Xk = 1|X0 = j}
Moreover, by Blackwell theorem, it exists

1
lim E[Rij (n)] − E[Rij (n − 1)] = , πi ∀j
n→∞ E[Ti ]
but

n n−1
(k) (k) (n)
X X
E[Rij (n)] − E[Rij (n − 1)] = Pij − Pij = Pij
k=1 k=1
n
hence the element (i, j) in the matrix P .

Thus

 
π1 π1 ... π1
 
 π2
n π2 ... π2 
lim P = 
 π
 = [π, π, ..., π]
n→∞
 3 π3 ... π3 
... ... ... ...
and, nally, this implies that

h i
w = lim P(n) = lim Pn p(0) = [π, π, ..., π]p(0) = π 
n→∞ n→∞

6.6 Canonical form


In every DTMC, the states can be grouped in sets. Those are T , C1 , C2 , ... , Ck . Where T is the sets of the

transitory states and C1 , C2 , ... , Ck is a countable family of disjoint and irreducible subchains of recurrent states.

If a chain starts in T, after a nite amount of time it evolves in one of the recurrent classes Ci with a certain

probability pi . Once the chain enters in a recurrent class then it will stay there forever. A brief interpretation in

given in the following gure.

Note that the transitory states can be divided in disjoint classes, but all of them are transitory. An instance is

given in the following gure.

6.6.1 Canonical form of P


In every DTMC, the transition matrix can be viewed as a block matrix if the states are organized as S =
{C1 , C2 , ..., Ck , T }. As it follows

80
Figure 103:

 
P1 0 0 ... R1
 0 P2 0 ... R2 
 
 
P=
 0 0 ... 0 ... 

 ... ... 0 Pk Rk 
 

0 0 ... 0 Q
Indeed, an upper triangular matrix.

Where all the zeros are due to the fact that recurrent classes doesn't communicate one to another. Moreover is

it impossible, by denition of class, that from a recurrent class the chain goes to a transitory state.

Pi are stochastic matrices. Ri governs the transitions from the transitory states to the recurrent classes. Q
leads the transitions among transitory states.

It's just a matter of math to see

 (n)

P1n 0 ... R1
P2n
 
n
 0 ... ... 
P =
 ...

 ... ... ... 

0 0 ... Qn

81
Figure 104:

(n) Pn−1
where Ri = j=0 Pn−1−j
i Ri Qj .
If the chain starts from a recurrent class, let's say C1 , we have

   
p̂(0) Pn1 p̂(0)
   
 n 0   0 
p(n) = P  = 

 ...  
  ... 

0 0

Thus means that a chain that starts in C1 stays in C1 (generally if starts in Ci stays in Ci ).
Moreover if n→∞ then the probability of being in a transitory state will be null (i.e. Qn → 0).

Note From these considerations it can be seen that if the chain has more recurrent classes it can't be ergodic.

Indeed, if p(0) is dened only in Ci , then the statistical properties of the chain will be those of the subchain Ci .
If we measure the statistics (time averages) of the whole chain they will converge to the statistics of the subchain

Ci . This because there are more stationary distributions, one for every recurrent subchain, excited by the initial

vector p(0).

Note In a periodic and irreducible chain doesn't exist a a stationary distribution, despite the fact that a statistic

of the chain will lead us to the distribution π of the chain.

6.7 Geo/Geo/1
Consider a time slotted system. Arrivals (Ak ) are independent slot by slot. Arrivals are Bernoulli distributed

 A =1 w.p. p
k

 A =0
k w.p. (1 − p)

The queue has an innite buer.


Suppose Early Arrivals and Late Departures (EA/LD). Ie arrivals appears at the beginning of the slots and
departures at the end, as it follows.

82
Figure 105:

The departures work this way: at the end of the slot, if there are packet to be sent, a diaphragm opens with
probability µ (it stays closed with probability 1 − µ).
It's asked to study the statistics of the process Qk = {number of clients in the queue at the end of the slot}.

Solution The update law of Qk is

Qk+1 = Qk + Ak+1 + Dk+1

where P {Dk+1 = 1|Qk + Ak+1 > 0} = µ and P {Dk+1 = 1|Qk + Ak+1 = 0} = 0. Remember Ak , Dk {0, 1}.
Therefore the statistics of Qk+1 will be independent from the past given the present Qk ⇒ it's a DTMC.

First step is to build the transition diagram of the DTMC from the updating law.

The states of Qk are 0, 1, 2, ..., ∞. The possible transitions are: the state increases of 1, the state decreases of 1

or the state stays the same.

Let's nd the transition probabilities

1. If Qk = 0 then P10 = pµ̄ and P00 = 1 − pµ̄.

2. If Qk > 0 then Pi+1,i = pµ̄, Pi−1,i = p̄µ and Pi,i = 1 − p̄µ − pµ̄.

Where p̄ = 1 − p and µ̄ = 1 − µ.
If p>0 and µ>0 then the chain is irreducible and innite. If 1 − p̄µ − pµ̄ > 0 then it is aperiodic, otherwise

it is periodic with period d = 2.


Second step is to build the transition matrix

 
p00 p̄µ 0 0 ...
 pµ̄ p11 p̄µ 0... 
 
 
P=
 0 pµ̄ p22 p̄µ  T ridiagonal

 0 0 pµ̄ ... ... 
 

... ... ...


The DTMC has only one class of all recurrent or all transitory states. The chain will be ergodic if they are

positive recurrent. If the chain is ergodic it will have a limiting distribution π (with π _i>0).
Evaluate the limiting distribution and thus the ergodicity conditions.


 π = Pπ (1a)
 |π| = 1 (1b)

83
Figure 106:

Figure 107:

From the explicit form of P the relation (1a) becomes


 π0 = (1 − pµ̄)π0 + p̄µπ1
i−1 + (1 − p̄µ − pµ̄)πi + p̄µπi+1
 π = pµ̄π
i

Rewriting now the system and giving some names


 f0 = pµ̄π0 − p̄µπ1 = 0
i−1 = pµ̄πi−1 − p̄µπi = pµ̄πi − p̄µπi+1 = fi
 f

Hence all fi are equal to zero. Thus

pµ̄πi−1 = p̄µπi

It seems that the principle of equilibrium ow balance is working.


 
pµ̄
Dening Y , p̄µ we obtain πi = Y πi−1 . Working out this relation

84
Figure 108:

π0

π1 = Y π 0

π2 = Y 2 π0

and so f orth up to

πi = Y i π0

To nd Y we apply (1b):



∞ ∞  ∞
X X Y ≥1
1= πi = π0 Yi =
 π0 Y <1
i=0 i=0 1−Y

therefore, if Y < 1 then πi > 0 ∀i, thus all states are positive recurrent, i.e. ergodic (moreover if Y > 1 all states
are transitory and if Y = 1 all states are null recurrent).
The condition Y < 1 implies p > µ, that is the stability condition of the queue Geo/Geo/1.

For a stable queue

p
1− µ
π0 = 1 − Y =
1−p
Finally, remembering that server utilization fraction is

1
ρ = λS̄ = pS̄ = p ·
µ
thus

85
π0 (1 − p) = 1 − ρ

π0 (1 − p) is the probability that the system is idle at the generic given time t. Is that meaningful?

Figure 109:

Yes it is. π0 (1 − p) is the probability that the queue it's idle for all the duration of the slot.

Average occupation and delay time

P {Qk = i} , πi = (1 − Y )Y i i = 0, 1, 2, ... (geometric)

thus

Y pµ̄
E[Qk ] = =
1−Y µ−p
Is that possible to know the average delay time using Little from this relation? Yes it's possible, but paying

attention. Indeed, in the k+1 slot, we have

Q(t) = Qk + Ak+1

E[Q(t)] = E[Qk ] + p

86
Figure 110:

So, Little's law is related to the long-term average occupation, averaging over all times (but for a set of points

with zero measure). Hence, Little yields to

E[Qk ] µ̄
E[Q(t)] = E[D] · p ⇒ E[D] = 1 + ⇒ E[D] = 1 +
p µ−p

Figure 111:

6.8 Stationary distribution with ow balance


The equation π = Pπ has a physical meaning. For the stationary distribution π can be stated the following



 f or a single state
∀i and ∀n ⇒ P {Xn 6= i, Xn−1 = i} = P {Xn = i, Xn−1 6= i}

 (A)

 ∀R and ∀n ⇒ P {Xn ∈
/ R, Xn−1 ∈ R} = P {Xn ∈ R, Xn−1 ∈
/ R} (B)
generally f or a macrostate R

In common words, the probability that the chain goes in R in the next step is equal to the probability that the

chain goes out from R in the next step.

87
Proof Exploiting π = Pπ we obtain
X
πi = pij πj ∀i ∈ S (1)
j∈S

Where πi = P {Xn = i} and P {Xn = i|Xn−1 = j}. Thus by simple probability theory

X
X X {Xn = j}
pij πj = P {Xn = i, Xn−1 = j} = P {Xn = i, j∈S
}
j∈S j∈S | {z }
Sure event
Moreover, outgoing probabilities sum to one:

X
Pji πi
πi j∈S
= zX}| { (2)
| {z } pij πj
1 j∈S

i.e.

X X
pji πi = pij πj (3)
j∈S,j6=i j∈S,j6=i

because the terms πi Pii disappear in both sides.

X X
P {Xn = j, Xn−1 = i} = P {Xn = i, Xn−1 = j}
j∈S,j6=i j∈S,j6=i
   
 X   X 
P {Xn = j}, Xn−1 = i =P Xn , {Xn−1 = j}
   
j∈S,j6=i j∈S,j6=i

and thus the (A) is proven.

Let's move to (B). Summing to (3) all the states in R

XX XX
pji πi = pij πj
i∈R j ∈R
/ i∈R j ∈R
/

the terms pji πi in which both i and j belong to R disappear. We obtain the following

XX XX
P {Xn = j, Xn−1 = i} = P {Xn = i, Xn−1 = j}
i∈R j ∈R
/ i∈R j ∈R
/

X X X X
P{ {Xn = j}, {Xn−1 = i}} = P { {Xn = i}, {Xn−1 = j}}
j ∈R
/ i∈R i∈R
/ j∈R

P {{Xn ∈
/ R}, {Xn−1 ∈ R}} = P {{Xn ∈ R}, {Xn−1 ∈
/ R}} 

Graphical interpretation Balance the ow of the closed surface that denes R.

π1 p61 + π2 p82 + π5 p75 = π7 p47 + π8 p38

88
Figure 112:

This balancing can be applied to every macro state R, i.e. at every surface that contains DTMC states. From

this are found relations between {πi } involved in the balance.

6.9 Geo/Geo/1/B

Figure 113:

The system works the same as before. The only dierence is that this one can hold only B users (buer has

dimension B ).
Of this system study the statistics of Qk .

Solution From the state transition diagram

Figure 114:

The only novelty is that the system is buered. In the last state (B ) works this way: if Qk = B , because of the

early arrivals and late departures assumption, the probability of going in B−1 is:

89
PB−1,B = µ

Thus, the steady-state distribution can be found with the ow balance


 π · p̄µ = π
i i−1 · pµ̄ i = 1, 2, 3..., B − 1
 π ·µ=π · pµ̄
B B−1

pµ̄
we dene, as always, Y = p̄µ and we obtain

 πi = Y i π0 i = 1, 2, 3..., B − 1
 π = Y B π (1 − p)
B 0

Normalizing

" B #
1 − Y B+1
X  
i B
1 = π0 Y − Y p = π0 − Y Bp
i=0
1−Y

after some math

1−Y
π0 =
1 − µp Y B

(µ − p)Y B
πB =
µ − pY B

1 1
Note that for p = µ ⇒ Y = 1 ⇒ π0 = B+1−µ w B for B large.

(1)

6.9.1 Throughput and loss


The throughput is the average number of enterings [pcks/slot] is

S = parrival · parrival enters = p(1 − πB )

where πB is called block probability.

The average number of lost packets per slot is

Ploss = pπB

Fixed a maximum tolerable loss (e.g. Ploss < 10−6 ), increasing B we extend the range [0, pmax ] in which the

system works. Either way, when B ≥ 16, also doubling B , Pmax increases of a little bit.

Note It's a best practice to have some sort of checking methods to verify the results. A check can be evaluating

the throughput as the average number of packets outgoing from the network.

S = P {1 leaving at k} = |P {Qk−1 {z
+ Ak > 0} ·
}
µ
|{z}
Someone in here diagphram opens

hence

90
Figure 115:

S = (1 − π0 (1 − p)) · µ

This result has to coincide with the ingoing throughput: S = p(1 − πB ). There is a relation between π0 and πB
that can help us to verify our results.

Note An upper-bound on the block probability (πB ) can be found studying the queue Q∞
k (system with innite

buer):


X
πB ≤ P {Q∞
k ≥ B} = (1 − Y ) Yi =YB
i=B

(that is the boundary showed in the Ploss gure as a dashed line).

This boundary is valid for any queue, not only the Geo/Geo/1.

6.9.2 Delay
Let's study D̄ of the packets which enter in the system. Little's law on the stable part of the system yields to

E[Q(t)] = E[D] · p(1 − πB )


z }| {
E[Qk ] + p(1 − πB )

91
Figure 116:

Figure 117:

from which

E[Qk ]
E[D] = 1 +
p(1 − πB )
where
B
X
E[Qk ] = iπi
i=0

B
When the queue reach the saturation, the buer is full. The delay time tends to B · S̄ = µ.

6.10 Slotted aloha


This is a N nodes network. Arrivals are ∼ Bernoulli(p). For each node there is only the server (i.e. buer length

is zero). Qk = n represent the number of nodes full in the system at the end of the k th slot. When there is a

client on a node, it tries to transmit with probability q. If a new client arrives with a client already in service the

transmission is lost.

Considering all of these evaluate the distribution of {Qk }.

92
Figure 118:

Figure 119:

Solution Say that

Ak = number of new arrivals in k

Dk = number of departures in k ∈ {0, 1}

The update law will be

Qk+1 = Qk + Ak+1 − Dk+1

and, of course, is a DTMC.

The transition diagram is

Let's nd the transition probabilities. Let be Qk = n.


New arrivals (in the slot k + 1) can appear int the N −n free rooms. They have binomial distribution:

!
N −n
a(i, n) , P {Ak+1 = i|Qk = n} = pi (i − p)N −n−i i = 1, ..., N − n
i
If Ak+1 = 1 arrivals appear, then in the slot there are Qk +Ak+1 = n+i clients. Every client tries, independently

from the others, to transmit with probability q. There is a successful transmission if and only if only one client tries

to transmit in the slot. This event has probability

93
Figure 120:

Figure 121:

d(i, n) , P {Dk+1 = 1|Ak+1 = i, Qk = n} = (i + n)q(1.q)i+n−1

Hence, if Qk = n > 0

Pn+i,n = a(i, n)[1 − d(1, n)] + a(i + 1, n)d(i + 1, n)

Pn+(n−N ),n = a(N − n, n)[1 − d(N − n, n)]

Pn−1,n = a(0, n)d(0, n)

and if Qk = 0

Pi,0 = a(i, 0)[1 − d(i, 0)] + a(i + 1, 0)d(i + 1, 0)

PN,0 = a(N, 0)[1 − d(N, 0)]

P0,0 = a(0, 0) + a(1, 0)d(1, 0)

Finally we nd the stationary distribution π = Pπ .

n+1
X
πn = πi pn,i
i=0

This equation can be resolved with a recursive computation

94
Figure 122:

1 − P00
π0 = π0 P00 + π1 P01 ⇒ π1 = π0
P01

1 − P11 P10
π1 = π0 P10 + π1 P11 + π2 P12 ⇒ π2 = π1 − π0
P12 P12

...

  n
1 − Pn−1,n−1 X Pn−1,n−i
πn = πn−1 − πn−i
Pn−1,n i=2
Pn−1,n

Numerically all πn can be evaluated. Moreover, all are related to π0 .


P
To nd π0 we normalize πi = 1 and we nally obtain π.

Figure 123:

Analysis of results In the gure is depicted the throughput per user, as a function of the oered loadp (see

Geo/Geo/1/B) for a network with N = 30 nodes.

The curves grow laying on a line S=p until they start to be lost.
1
For low values of q (i.e. q = 0.005), then Sn (p) is monotone increasing. If q grows up to q= N , the curves stay

95
1 ∂Sn (p)
monotone and the value S grows. When q= N , the curves Sn (p) have a maximum (i.e.
∂p ). At the maximum
there is congestion, but we will see this concept later.

For every q, the saturation throughput is S(1) = N · q · (1 − q)N −1 (i.e. every node has a packet to transmit).

The value of q that maximize the saturation throughput is q= 1


N . With q= 1
N ⇒ S(1) = (N − 1)N −1 . Moreover,
−1
if there is a large number of nodes then N →∞⇒e = 0.36.
An analysis can be done with the continuous case (with ∼ P oisson(λ) arrivals) with deterministic service time

(with Dp seconds). We have:

p = P {at least one arrival in the slot} = 1 − e−λDp

Figure 124:

In the following gure is depicted the behavior of S and D̄ versus G = N λDp .

Figure 125:

See that the saturation throughput is ' e−1 ' 0.36.


Those curves are the equivalent S = Ge−G obtained with the simplied analysis in the rst part of the course.

Now, ∀G ∈ [0, ∞] we obtain couples (S, D̄ ) and we plot a graph of them in the following gure.

For low q (e.g. q = 0.008) the curve is monotone increasing and the delay is high (there is a low probability of

transmission).
1
When q= N the curve is monotone and the delay is the minimum among all the monotone curves.

96
Figure 126:

1 ∂S
For q<N the curve is no longer monotone, there is congestion ( ∂ D̄ < 0).
N Q̄k
All points at full load accumulate over the limiting curve D̄ = 1 + 1+ Q̄k = N .
S (obtained from S , when

6.10.1 Dynamics
The evolution over the time of the process Qk can be obtained studying E[Ak |Qk−1 = n] and E[Dk |Qk−1 = n].
When the arrival rate is higher than the departure rate then, on average, Qk tends to increase. In the opposite

case, on average, it tends to decrease.

Consider now the two gures reported below. In the rst are visible the 3 points belonging to falling front of

the throughput (p = 0.007, 0.008, 0.009). In the second are shown the average arrivals/departures on the left and

the steady state distribution on the right, for those probabilities p.

6.11 M/G/1 queue


The queue has a service time of S ∼ fS (t).
Dene Q(t) = {number of the system at time t} and Qk = {number of the system af ter k th departure}. As it is

shown below

The queue can be studied looking at Q(t) at the departure of a client. The update law of the discrete-time

process Qk is:


k+1 − 1
 Q +B Qk > 0
k
Qk+1 (1)
 B k+1 Qk = 0

Where Bk are the number of arrivals during the service time (Sk ) of the k-th client.

By the fact that arrival are Poisson (thus exponential interarrival time, i.e. memoryless) every departure is a

renewal. Remember that from that point on the process will proceed forgetting about the past. Indeed, what links

to the past the process is the residual time of the service Sk (that is General, i.e. not memoryless).

The state diagram is the following:

See that is identical to the Slotted Aloha one with N =∞ nodes. Let's nd the transition probability.

Dene bi , P {Bk = i} the PMF of the arrivals Bk . Hence

97
Figure 127:

ˆ ∞ ˆ ∞
e−λt (λt)i
bi = P {Bk = i|Sk = t}fS (t)dt = · fS (t)dt (2)
0 0 i!
(T P )

That can be computed in closed form knowing fS (t), the PDF of the service time.

Thus


n+1,n = P {Qkk+1 = n + i|Qk = n} = P {Bk+1 = i + 1} = bi+1
 P Qk > 0
 Pi,0 = P {Qk+1 = i|Qk = 0} = P {Bk+1 = i} = bi Qk = 0

The stationary distribution can be found computing numerically (iteratively as in Aloha). We obtain the

following

1 − P00 1 − b0
π1 = π0 = π0 (3.1)
P01 b0

n
1 − Pn−1,n−1 X Pn−1,n−i
πn = πn−1 − πn−i n ≥ 2 (3.1)
Pn−1,n i=2
Pn−1,n

98
Figure 128:

n
1 − b1 X bi
πn = πn−1 − πn−i n ≥ 2 (3.2)
b0 b
i=2 0

Note that

π0 = P {Qk = 0} = P {system idle} = 1 − ρ (3.3)

where ρ = λ · S̄ .
From (3.1) to (3.3) the steady state distribution π can be found.

6.11.1 Alternative method: Probability Generating Functions


Let's see now an alternative method based on Probability Generating Functions (PGF).

Aside (Generating Functions)

99
Figure 129:

Figure 130:

Denition (MGF) Given a continuous random variable X, the Moment Generating Function is dened as

ˆ +∞
φX (s) , E[esX ] = fX (t)est dt ∀s ∈ C (where integral converges)
−∞

This is the bilateral Laplace transform of the PDF fX (t).

Denition (CF) The characteristic function is dened as

ˆ +∞
jωX
ΦX (s) = E[e ]= fX (t)ejωt dt ∀ω ∈ R
−∞

This is the Fourier transform of fX (t).

Denition (PGF) Given a discrete random variable X, the Probability Generating Function is dened as


X
ΓX (z) = E[z X ] = pX (n)z n ∀z ∈ C
n=−∞

This is the Z transform of the PMF pX (n) of X.


The three transforms have the usual properties of Laplace, Fourier and Z. Linearity, convolution theorem and

uniqueness of the couple function/transform.

Those transforms are useful to evaluate sums of random variables and moments of random variables.

Example(Sum of random variables) Given X and Y independent random variables, nd W =X +Y

ΓW (z) = E[z W ] = E[z X+Y ] = E[z X ]E[z Y ] = ΓX (z)ΓY (z)


(ind)
The product of the Z transforms is the discrete convolution of the PMFs.

100
Figure 131:

Properties of GF
´
1. φX (0) = 1, because
R
fX (t)dt is equal one, because of normalization.

dk
2. E[X k ] = dsk φX (s) , this is known as Moments' theorem.

s=0

Properties of PGF
1. ΓX (1) = 1, always because normalization.

dk
2. E[X(X − 1)(X − 2)...(X − (K − 1))] = Γ (z) , the Moments' theorem for PGFs

dsk X z=1

1 dn

3. PX (n) = n! dsn ΓX (z) z=0 , that is known as the inversion formula for
X ∈ {0, 1, 2...}

Solution of the problem using Probability Generating Functions


Let's go back to the problem stated so far. The π is solved from π = P π, actually:

    
π0 b0 b0 ... ... π0
    
 π 1   b1 b1 b0 ... 
  π1 
 
 π = b
  
 2   2 b2 b1 ...   π2 
 

... ... ... ... ... ...
explicitly

π0 = π0 b0 + π1 b0

π1 = π0 b1 + π1 b1 + π2 b0

...

πn = π0 bn + π1 bn + π2 bn−1 + ... + πn b1 + πn+1 b0

Now, multiply the n-th row times zn, and sum over all n


X ∞
X ∞
X ∞
X ∞
X
πn z n = π0 bn z n + π 1 bn z n + π2 bn z n+1 + π3 bn z n+2 ...
n=0 n=0 n=0 n=0 n=0

Q(z) = π0 B(z) + π1 B(z) + π2 zB(z) + π3 z 2 B(z)

101
Q(z) = P (z)[π0 + π1 + zπ2 + z 2 π3 + ... ]
| {z }
z −1 (Q(z) − π0 − π1 z)

zQ(z) = B(z)[z(π0 + π1 ) + Q(z) − (π0 + π1 z)]

π0 (1 − z)B(z) = Q(z)(B(z) − z)

π0 B(z)(1 − z)
Q(z) = (4)
(B(z) − z)
Limit limz→1 the equation of Q(z), obtaining

B(z)(1 − z) B 0 (z)(1 − z) − B(z)


lim Q(z) = π0 = lim π0
z→1 B(z) − z z→1 B 0 (z) − 1
Hopital
and nally

−1
1 = π0 ⇒ π0 = 1 − E[B] = 1 − λS̄ = 1 − ρ
E[B] − 1
Blackwell

Find now the B(z)

∞ ∞ ˆ ˆ ∞
!
∞ n ∞
X
n
X
−λt (λt) n −λt
X (λtz)n
B(z) = bn z = e z fS (t)dt = e fS (t)dt
n=0 n=0 0 n! 0 n=0
n!
(2)
ˆ ∞
B(z) = e(λz−λ)t fS (t)dt = φS (λz − λ)
0

Where φS (λz − λ) is the MGF of S, shortly indicated as S̃(λz − λ).


Therefore the relation (4) becomes

S̃(λz − λ)(1 − z)
Q(z) = (1 − ρ) (5)
S̃(λz − λ)z

(4) states the PGF of Qk (discrete) related to S̃ (continuous). The inverse transform of (5) is (3).

Dierentiating with respect to z and then limiting limz→1 we obtain the expected value

λ2 S¯2
E[Qk ] = lim Q0 (z) = ρ+ (6)
z→1 2(1 − ρ)
you do the math

Little's law is used to compute the average delay time spent in M/G/1 queue

E[Q(t)]
E[D] =
λ
What's the link between E[Qk ] and E[Q(t)] (assuming that ρ < 1, then {Qk } is ergodic)?

102
Let's say

• πD is the steady state distribution seen from a departing client.

• πA is the steady state distribution seen from an arriving client

• πt is the steady state distribution seen over all times

Figure 132:

In every queue in which: there are single arrivals and single departures or are single server with non-group

arrivals, then fraction of time in which an arrival sees Q=n is equal to the fraction of time in which a departures

leaves Q = n. In other words: number of crossing of n upwards = number of crossing of n downwards.


A D
Interpreting π as long-term fractions (ergodic system) we conclude that: π =π .

Moreover, there are Poisson's arrivals, i.e. PASTA property holds πt = πA .


Finally, it is valid the relation πt = πD , and thus


X ∞
X
E[Q(t)] = nπnt = nπnD = E[Qk ] (at departures!)
n=0 n=0

and hence

E[Qk ] λS¯2
E[D] = = S̄ + (note that is P K 0 s)
λ 2(1 − ρ)
(6)

With a further investigation we nd the PMF of the delay time (D ), not only its average value (D̄ ).

If the queue has a FIFO policy, then

πnD = P {Qk = n}

= P {n in the system at the departure of ”test”}

= P {n of arrivals during delay time D of the ”test” client}

ˆ ∞
= P {n arrivals|D = t}fD (t)dt
0
(T P )

103
ˆ ∞
(λt)n
= e−λt fD (t)dt
0 n!
As in relation (3), the PGF of this is

Q(z) = φD (λz − λ) = D̃(λz − λ) (7)

Using (5) and xing s = λ(z − 1), we obtain the MGF of D:

s · S̃(s)
D̃(s) = (1 − ρ) (P K transf orm f ormula)
s + λ + λS̃(s)
In this formula it's related the MGF of D to the MGF of S. The above formula can be inverted denoting s = jω
and evaluating the inverse Fourier transform.

6.12 M/G/1/B
Same queue as so far, but in this case it's buered.

Look at the gure.

Figure 133:

The behavior of Q(t) is the following.

Figure 134:

Where Qk = {# of clients at k th departure} and Qk ∈ {0, 1, 2, ..., B − 1}.


The steady state distribution (π ) satises the following

     
π0 b0 b0 0 ... π0
     

 π1  
  b2 b1 b0 0 ...  
  π1 

 π2   b3 b2 b1 b0 0 ...   π2 
= ·
     
 

 ...  
  ... ... ... ...  
  ... 


 ...  
  b0  
  ... 

PB−2 PB−2 PB−3
πB−1 1− bn 1− bn 1− bn 1 − b0 πB−1

The last row is the sum of all the rows from B−1 to ∞ of the matrix we found in M/G/1 not buered.

104
The steady state distribution is then π

πi∞
πi = B−1
! i = 0, 1, ..., B − 1
X

πn
n=0
| {z }
normalization

Since transition +1 and -1 are balanced, then also here πD , yet found, is equal to πA , the PMF seen from an

arrival that enters in the system. Contrary wise, the Poisson arrivals oered to the system see one more state:

B (i.e. full system). Hence the distribution π̂ A , seen by Poisson arrivals, has the state B in addiction. But the
A
components i ∈ {0, ..., B − 1} have to be proportional π . Finally

π̂iA
πiD = πiA = A
i = 0, 1, ..., B − 1
1 − π̂B

And by PASTA property π̂ A = π t this distribution coincide with the distribution over all times.
A
The unknown π̂ B can be found as it follows

ρ0 λ0 · S̄ 1 − π0t
z }| { = z A
{ ⇒ (1 − π̂B
}| )= (5)
1 − π0t λ(1 − π̂BA
) · S̄ λS̄

We obtain for i = 0 : π̂0A = (1 − π̂B


A
) · π0D , and because π̂0A = π0t
(3) (4)

(1 − π0t ) D
⇒ π0t = π0A = · π0
λS̄
(4) (5)

from which we obtain π0t

π0D
π0t = (6)
π0D + λS̄
Substituting (6) in (3)

πiD
πit = π̂iA =
π0D + λS̄
(4) (3)
PB−1 iπiD t E[Q(t)]
Finally E[Q(t)] = 0 π0D +λS̄
+ < B · πB . By Little's then the average delay time is E[D] = λ0 .

6.12.1 Example: M/G/1/B


1 µ
Let's suppose exponential service times S ∼ exp(µ) (hence, S̄ = µ ). The services MGF is φS (s) = µ−s , S̃(s).
Substituting in Q(z) formula for innite buer (ρ , λS̄ = λ/µ) we obtain

S(λz − λ)(1 − z) (1 − ρ)µ(1 − z) (1 − ρ)


Q(z) = (1 − ρ) = = ... =
S(λz − λ) − z µ − z(µ + λ − λz) 1 − ρz
Antitrasforming we obtain

105
Z −1 {Q(z)} → πn∞ = (1 − ρ)ρn n = 0, 1, 2, ... (geometric)

Thus (from relation (2)) the steady state PMF of the queue with buer B is

(1 − ρ)ρn
πnB = n = 0, 1, 2, ..., B − 1 (truncated geometric)
1 − ρB
The normalized throughput is ρ0 = λ0 S̄ = 1+
1
1−ρ . And the normalized delay comes out from Little's
ρ(1−ρB )
E[D] E[Q(t)]
D̂ = S̄
= ρ0 .

Figure 135:

6.12.2 Example: CSMA-CD with mini-slot


Given: ∼ P oisson(λ) arrivals from each node (continuous). Service time for a packet has a duration of Dp (sec).
Slotted time, divided in mini-slots of duration ∆ (sec). A mini-slot is equal to the round trip time, 2τ , spent in

reserving the channel. Each node has only one packet in the buer. A packet, which arrives in an idle slot, tries to

transmit with probability q. A packet, which arrives when a transmission occurs, is considered backlogged (it will

try to transmit after, always with probability q ). Every packet transmission must be followed by an idle slot (nodes
Dp
can transmit only after sensing an idle slot). The transmission acts over M = ∆ slots (assume M is an integer

number).

Dene

Qk = {number of clients in the system at the end of the k th slot}

An instance of the channel behavior is depicted in the following picture.

106
Figure 136:

Figure 137:

Let's study the renewal process {Qk , k = 1, 2...}, indeed a DTMC.

Update law and state diagram The update law can be found with the reasoning below.

Figure 138:

As you see an idle slot can be followed by

• transmission of a packet

• another idle slot

• a collision

107
Hence


 Q + arrivals on M + 1 slots A
 k


Qk+1 = Qk + arrival on 1 slot B (1)


C

 Q arrivals on 2 slots
k

If Qk = n, hence each of the N −n free nodes will have a packet at the end of the k+1 slot, with probability


 P = 1 − e−λ(M −1)∆ A
 a


Pb = 1 − e−λ∆ B (2)


P = 1 − e−λ2∆ C


c

Hence the number of arrivals Ak+1 has the following statistics

!
N −n
aE (i, n) = P {Ak+1 = i|Qk = n, E} = pie (1 − pe )N −n−i (bimonial) (3)
i

Where e ∈ {a, b, c}and E = {A, B, C}.


At slot k, there are Qk = n packets in the network. After an idle slot they can try to transmit. As in the

following:




 P {A|n} = P {1 T X well ended} = n · q · (1 − q)n−1

P {B|n} = P {0 T X well ended} = (1 − q)n (4)


 P {C|n} = P {more than 2 T X well ended} = 1 − (1 − q)n − n · q · (1 − q)n−1 = 1 − (1 − q)n−1 (1 − q(1 − n))

The state diagram is the same as in the Aloha, but dierent transition probabilities.

Qk = n > 0 ⇒ Pn+i,n = P {i arrivals, 0 departures|Qk = n} + P {i + 1 arrivals, 1 departures|Qk = n}

= P {Ak+1 = i, BU C|Qk = n} + P {Ak+1 = i + 1, A|Qk = n}

= P {Ak+1 = i|Qk = n, B}P {B|n} + P {Ak+1 = i|Qk = n, C}P {C|n} + P {Ak+1 = i + 1|Qk = n, A}P {A|n}

From (3) and (4) we can nd the ingredients for the evaluation of the probabilities


 P = ab (i, n)P {B|n} + ac (i, n)P {C|n} + aa (i + 1, n)P {A|n}
 n+i,n


Qk = n > 0 ⇒ Pn+(N −n),n = ab (N − n, n)P {B|n} + ac (N − n, n)P {C|n} (5)


P {n − 1, n} = a (0, n)P {A|n}


a

If Qk = 0, the game is dierent.

P {B|∅}
Qk = 0 ⇒ Pi,0 = ab (i, 0) · | {z }
1

108
That is a special case included in the more generic formula (5).

Now we have all the ingredients to nd the steady state distribution π (always with the same iterative algorithm

that we used in Aloha).

Throughput Said that, at steady state the aggregate throughput is

pck
S = E[A] = E[D]
renewal
An we can evaluate it in two ways.

First way
N
X
S= E[A|ak = n]πn
n=0

Where E[A|ak = n] = E[A|Qk = n, A]P {A|n} + E[A|Qk = n, B]P {B|n} + E[A|Qk = n, C]P {C|n}, and A∼
Bin(N − n, Pa,b,c ), with average (N − n)Pa,b,c .
Using (2) and (3), then

XN (N − n){Pa n · q · (1 − q)n−1 + Pb · (1 − q)n + Pc (1 − (1 − q)n−1 (1 − q(n + 1)))}


S= | {z } πn (6)
n=0 E[A|Qk = n]

Second way
N
X N
X
S= E[D|Qk = n]πn = n · q · (1 − q)n−1 πn (7)
n=0 n=0
math is below

E[D|Qk = n, A]P {A|n} = 1 · n · q(1 − q)n−1


| {z }
P {A|n}
If the calculations are correct, then the two ways will lead to the same result.

Now we desire the throughput S in pck/slot, where a slot is equal to M mini-slots (the slots needed for a

transmission of a packet).

How many mini-slots there are in one average cycle?

E[C] = (M + 1) · P {A} + 1 · P {B} + 2 · P {C} minislots (8)


PN 1
Where P {E} = n=0 P {E|n}πn . Hence
E[C] will be the average numbers of renewals per mini-slot, nally

M
S = avg number of arrivals per slot = E[A] · E[C] (9)
z }| { z }| {
avg # arrival per slot avg # renewals per slot

Delay time and network number The average time spent in the system can be evaluated, as always, by

Little's.

109
Figure 139:

S
E[Q(t)] = z }| { · E[D] (10)
arrivals
z}|{
slot
slot
P
Where E[Q(t)] is approximated with Q̄ = n · πn .

Full load check When all nodes have one ready packet to send, then once more q= 1
N maximizes E[A] = E[D].
It is valid the following

1 N −1
E[D] = N q(1 − q)N −1 = (1 − ) → e−1
N
big N
Therefore

1 N −1
P {A|N } = (1 − ) → e−1
N

1 N
P {B|N } = (1 − ) → e−1
N

P {C|N } → 1 − 2e−1

Hence E[C] → (M + 1)e−1 + e−1 + 2(1 − 2e−1 ) = 2 + e−1 (M − 2).


Finally, from (9), the full load throughput is

M 1 1
S = e−1 · = '
2 + e−1 (M − 2) 2(e−1)
1+ M 1 + 3.43
M

This result is slightly dierent from the one we derived so far. This because here the model of the Ethernet

protocol is more accurate.

In gure is shown E[A], E[C] and S versus the oered load G = N λDp for a network with N = 30 nodes varying
the back-o q . M = 100 mini-slots. The curves E[A] are similar to those in the Slotted Aloha. Composing S and

E[D] is obtained the following

Also in here is necessary that q varies in function of the load. Ie, q needs to decrease when the number in the

system increase. Indeed, if q is xed, the bistability phenomenon (already shown in Aloha) can appear.

110
Figure 140:

7 Absorbing Markov Chains

In this chapter we will treat only nite chains (AMCs).

A DTMC in which the states are in part transitory and in part absorbent is said to be absorbing. Each ergodic

subchain is seen as an absorbing macro-state.

The canonical form of a AMC is the following

" # A T
I R z }| { z }| {
B= S = { 1, ..., r ; 1, ...., s } (1)
0 Q

where I is the identity matrix (r × r) and stochastic. Q is not stochastic.

Note If an ACM has more than r classes of states, then is not ergodic. Absorbing states are ergodic and they

don't communicate one to another.

Fact (Probability of falling in an absorbing state) In an AMC the probability of falling (ending) in an

absorbing state is 1 (this come from the denition of transitory states).

7.1 Some questions about AMCs


We want to answer to the following questions.

1. What is the average number of visit at each transitory state i? Given T , the number of steps before absorption,
what is the E[T ].

2. What is the distribution of T?

3. What is the probability that the AMC ends in a given absorbing state?

111
Figure 141:

7.1.1 Answer to 1
From the canonical form of P is obtained the following

" Pn−1 #
I R· k=0 Qk
P = n
(2)
0 Q
(n) (n)
Where Qn = {qij }, in which qij = P {Xn = i|X0 = j} and (i, j) ∈ T .
Because of, by the denition of transitory state, the probability of the chain to be in a transitory state when

n→∞ is 0, then

lim Qn = 0
n→∞

Therefore the series I + Q + Q2 + .... converges to (I − Q)−1 (as it happens with scalars).

The matrix

n
N =(I -Q)

is said to be the Fundamental Matrix of the AMC.

Note 1 This inverse matrix always exists.

Qn → 0 ⇒ spectral radius ρ(Q) < 1 ⇒ eigenvalues λ of Q are |λ| < 1

⇒ eigenvalues of (I − Q) are |1 − λ| > 0

112
Figure 142:

⇒ 0 is not an eigenvalue ⇒ (I − Q) is invertible 

Note 2 Qk R(I − Q)−1 (I − Qn ) = RN (I − Qn ) (2.1)


P
R· k can be written

Interpretation of the elements of N Suppose that the AMC starts in the state τ ∈ T (transitory) : {X0 = j}.
Dene the visit indicator function of the state i∈T as the following


 1 {Xn = i} i ∈ T
Ii (n) = (3)
 0 elsewhere

Dene Vi (n) = {# of visit in i ∈ T in [0, n]}. Evidently

n
X
Vi (n) = Ii (k) (4)
k=0

Averaging given the event {X0 = j} i ∈ T

n n
(k)
X X
E[Vi (n)|X0 = j] = P {Xk = i|X0 = j} = Pij (5)
k=0 n=0

(k)
Remember Pij is the element in position (i, j) in the matrix P k. Therefore

n
(k) (0) (1) (n)
X
= qij = [qij + qij + ... + qij ]
k=0

113
(k)
Where qij are the elements of the matrix Qk . Limiting for n → ∞, then


(k)
X
nij , E[Vi (∞)|X0 = j] = qij
k=0

Therefore


X
{nij } = Qk = (I − Q)−1 = N
k=0

Hence: the (i, j) element of N represent the average number of visits E[Vi (∞)|X0 = j] to the state i (transitory)
given that the chain is started in j (transitory too).

Now, given that

nij = E[Vi (∞)|X0 = j]

adding over all transient i, the total number of visit V (∞) before absorbing, starting from X0 = j , is

X X
E[V (∞)|X0 = j] = E[ Vi (∞)|X0 = j] = nij = ((1, ..., 1)N )
i∈T i∈T
LIN

Suppose that the AMC starts at t=0 from the transitory states with a given probability p̂(0). From the Total

Probability Theorem

s
X
E[V (∞)] = E[V (∞)|X0 = j]P {X0 = j} = (1, ..., 1) · N · p̂(0) (7)
j=1

Moreover

s
X
E[Vi (∞)] = E[Vi (∞)|X0 = j]P {X0 = j} (8)
j=1
TP
Hence

 
E[V1 (∞)]
E[ v(∞) ] = N · p̂(0) =  ...  (9)
 

culoumn E[V2 (∞)]

(9) is the vector of visits starting from the distribution p̂(0). The sum of the elements in the vector will give

E[V (∞)].

Alternative approach to compute E[Vi (inf ty)]

(5)
s
z }| !{
X ∞
E[Vi (∞)] = · P {X0 = j}
X
E[Ii (k)|X0 = j]
j=1
(8) k=0

114
 

X Xs
=  E[Ii (k)|X0 = j] · P {X0 = j}
k=0 j=0


X ∞
X
= E[Ii (k)] = pi (k)
k=0 k=0

In the picture a sketch of the meaning

Figure 143:

We are now almost done with the answer to the question 1. The only thing we are missing is the absorption

time T.

Absorption time T Dene the absorption indicator


 1 {Xn is in A at time n}
IA (n) =
 0 {Xn is in T at time n}

Figure 144:

From here is trivial to see that V (∞) = T . Now, E[T ] is known but we are also interested in the T's PMF.

7.1.2 Answer 2
Consider the state vector at time n:
 
p1 (n)
 
 ...  A
 
 p (n) 
 r
p(n) = 


 p̂1 (n) 
 
 ...  T
 
p̂s (n)
hence we have

115
X
pi (n) = P {Xn ∈ A} = E[IA (n)]
i∈A

But if Xn is an absorbing state, then it arrived there before n, i.e. {Xn ∈ A} ⇒ {T ≤ n}. Moreover this relation

is valid also in the other direction {T ≤ n} ⇒ {Xn ∈ A}. Therefore, by the fact that the two events are identically

the same event the CDF of T is

X
P {T ≤ n} = pi (n)
| {z }
i∈A
CDF of T
This is a numerical algorithm to compute the CDF of T.

7.1.3 Answer 3
From the relations (2) and (2.1) we have

" #
n ∞ (∞) I RN
lim P = P = {pij } =
n→∞ 0 0
hence

(∞)
pij = P {X∞ = i|X0 = j} = {RN }i,j i ∈ A, j ∈ T

Where P {X∞ = i|X0 = j} is the probability that the AMC ends up in i, given that it starts from j.

Figure 145:

116
Figure 146:

8 Continuous Time Markov Chains (CTMC)

Denition (CTMC) A process {X(t), t ≥ 0} is said to be a Continuous Time Markov Chain if it assumes

discrete values in a countable set of states S and it has the Markov property.

∀t > tn > tn−1 > ... > 0

P {X(t) = i|X(tn ) = jn , X(tn−1 ) = jn−1 , ..., X(0) = j0 } = P {X(t) = i|X(tn ) = j} (M )

Denition (Time homogeneous CTMC) A CTMC is said to be time homogeneous (or simply homogeneous)

if ∀s ≥ 0 and ∀t ≥ 0

P {X(s + t) = i|X(s) = j} = P {X(t) = i|X(0) = j} = pij (t)

Where pij (t) is called transition probability from j to i in the interval (0, t).

Denition (Transition matrix) For a time homogeneous CMTC is dened the transition matrix as the following

117
Figure 147:

P (t) = {pij (t)}

For the transition matrix is valid that P (0) = I .

8.0.4 Counting Poisson Process


The counting poisson process is A(t) = {# of arrivals in (0, t)} with rate λ.For this process we have the following

(λt)i−j e−λt
P {A(t) = i|A(0) = j} = pji (t) = P {(i − j) arrivals in (0, t)} = i≥j
(i − j)!
Thus, this process is a CTMC because it satisfy the Markovity.

8.1 Sojourn time


Theorem If X(t) is an homogeneous CTMC, then X(t) remains in a certain state for a time Ti ∼ exp(νi ). The
1
average sojourn time is
νi and it depends from the state. The sojourn times {Ti } are independent random variables.

Proof Markovity says that every instant tn is a renewal (from that instant on the process continues without

memory).

Homogeneity means that the origin of the time axis is moved to the beginning of the sojourn in i.
Suppose now that X sojourned in the state i for s seconds. Hence is veried the event A = {Ti ≥ s} =
{chain stays in i ∀t ∈ [0, s]}. Given that what's the probability that it stays there t more seconds?

P {Ti ≥ t + s|Ti ≥ s} =?

118
Figure 148:

= P {A e { chain in i ∀t0 ∈ (s, s + t] }|A} = P {B|A}


| {z }
B

= P {chain in ∀t0 ∈ (s, s + t]|X(s) = i}


(M )

= P {chain in ∀t0 ∈ (0, t]| X(0) =i 0


| {z } } = P {chain in ∀t ∈ [0, t]}
(HOM ) sure event

? = P {Ti ≥ t}

That shows that Ti ∼ exp(·). Because exponential distribution is the only distribution that satisfy this property.

8.1.1 Constructive view of a DTMC


When a CTMC X(t) leaves j it goes to i with a given probability qij . All the {qij } are the transition probabilities

of an embedded DTMC, in which qii = 0. At each transition the CTMC spends an exponentially distributed time

119
Figure 149:

in the visited state.

8.2 Distribution at time t


For a given t, the PMF of the discrete random variable X(t) is pi (t) , P {X(t) = i}, i ∈ S . The PMF is organized

in the state vector

 
p0 (t)
p(t) =  p1 (t) 
 

...
This vector is named distribution of X at time t.
Let's now analyze the time evolution this vector. As for the DTMC, the PMF at time t+δ is obtained

conditioning on X(t)

X
∀i ∈ S pi (t + δ) = P {C(t + δ) = i|X(t) = j}pj (t)
j∈S
TP
In matrix form

p(t) = P (δ)p(t)

Let's take now the limit δ→0

 
p(t + δ) − p(t) P (δ) − I
lim lim
= δ→0 · p(t)
δ→0 δ δ
| {z }
Γ = {γij }
Where Γ is called innitesimal generator matrix.

Thus

d
p(t) = Γ · p(t) (Chapman − Kolmogorov CK)
dt
This equation has the following solution

p(t) = eΓt · p(0)

120
As the state of a LTI system with system matrix Γ.

8.2.1 How is madeΓ


Let's evaluate pij (δ) for δ → 0.
First is shown that if δ → 0, then only 0 or 1 transition can be present.

P {0 transitions in (0, δ)} = P {Tj > δ} = e−νj δ = 1 − νj δ + O(δ)


∼ exp T aylor

ˆ s ˆ ∞ 
P {1 transitions in (0, δ)} = P {Tj > δ, Tj + Ti > δ} = νj e−νj t νi e−ντ dτ dt
0 δ−t
∼ exp

νj
e−νi δ − e−νj δ

=
νj − νi
you do the math

νj
= (1 − νi δ + O(δ) − 1 + νj δ + O(δ)) = νj δ + O(δ)
νj − νi
taylor

P {2 transitions in (0, δ)} = 1 − (1 − νj δ + O(δ) − (1 − νj δ + O(δ))) = O(δ)

Therefore


 p (δ) = P {0 transitions in (0, δ)} = 1 − ν δ + O(δ)
jj j
f or i 6= j
 p (δ) = P {1 transition in (0, δ)} · q = q ν δ + O(δ)
ij ij ij j

Thus, by denition of Γ

pjj (δ)−1 1−νj δ+O(δ)−1
 γ = lim
jj δ→0 δ = limδ→0 δ = −νj < 0 (!)
pij (δ) qij νj δ+O(δ)
 γij = limδ→0 δ = limδ→0 δ = qij νj > 0

Where γij are the transition rates (or ows).

Note that

 
X
qij  ν = ν
X
γij =

j j
i∈S,i6=j
i∈S,i6=j
| {z }
=1
that is the transition rate out of j.
P
By the fact that γjj = −νj , then i∈S γij = 0 (i.e. the columns of Γ sum to zero).

Moreover is possible to evaluate the elements {qij } from the transitions rates.


 P γij j 6= i
γij
qij = i6=j
 0 j=i

121
Thus in matrix form

Q = I − [diagΓ]−1 Γ
 
1
γ11
−1 ..
 
where [diagΓ] =
 .
.

1
γnn

8.3 Steady-state distribution


If the embedded DTMC is ergodic, then the CTMC is also ergodic. Hence, exists and it's unique the limit

limt→∞ p(t) = π

In this case ṗ(t) → 0, thus the Chapman-Kolmogorov formula yields to

Γ·π =0

That means that π is a null vector for Γ. In a more specic form

X
γij πj = 0 ∀j ∈ S
j∈S

Remembering now that γij = −νi , the above equation becomes

X
νi πi = γij πj = 0 ∀i ∈ S (1)
j6=i

These last are called Whole Balancing Equations. The LHS of the equations represents the rate of going out

from i, being in i. The RHS of the equations represent the rate of going into i, being outside from i.
It is common to represent a CTMC with a state diagram (as we did for a DTMC). The arrows between a state

and another are are labeled with the transition rates γij (γii are omitted).

Fig A1.

Note that equations (1) are the ow balances to a given node. Those can be generalized to a given macro-state.

We introduce now thew : the steady-state distribution of the embedded DTMC. Thus

X
wi = wj qij ∀i ∈ S (W )
j6=i

From equations (1) and (W) it can be seen that

 
X νj
πi = πj qij ∀i ∈ S
νi
i6=j

It is trivial to prove the following (proof by replacement)

wi
νi
πi = P wj (2)
j∈S νj

122
9 Semi-Markov Processes

Denition (Semi-Markov process) A process X(t) is said to be Semi-Markov if it changes state according to
1
an embedded DTMC but the time spent in each state i depend from a generic PDF fTi (t) with expected E[Ti ] = νi .

Fact If w if the steady-state distribution of the embedded DTMC, then the fraction of time spent from the

Semi-Markov process X(t) in the state i is

wi /νi
πi = P ∀s ∈ S
j wj /νj

Proof Let be Vi (n) the number of visits to i in the rst n transitions and Ti (k) the time spent in i at the k th
visit. The fraction of time spent from X(t) in i in the rst n transitions is so

PVi (n)
T ime in i Ti (k)
=P k=1 
T otal time PVj (n)
T (k)
j∈S k=1 j

Hence, working out this formula with some tricks

t→∞
PVi (n) Vi (n)
k=1 Ti (k) Vi1(n) · n n→∞ E[T ] · wi wi /νi
P  P i =P =π
P Vj (n)
Tj (k) Vj1(n) ·
Vj (n) → E[Tj ] · wj j wj /νj
j∈S k=1 n
LLN
It can be proven also in a long term sense the transition πi is the limiting probability that the system will be in

the state i. Formally

lim P {X(t) = i} = πi
t→∞

Process with memory In a Semi-Markov Process is no longer valid the Markov Property (future is independent

from the past given the present). Indeed, the future depends on how long X(t) has been in a given state.

123

You might also like