# Simulation of a Computer Network

## Router as a Queuing System

Delay/Jitter:
- Transmission
- Service
- Processing
- Waiting

Quality of Service:
- Realtime
- Lossless

Representation:
- $A\left(t\right)$
- $D\left(t\right)$
- $W\left(t\right)$
- $W_Q\left(t\right)$
- $T_n$
- $S_n$
- $L_n$
- $L_{Qn}$

## Little's Law

\begin{equation}
\mathbb E\left[L\right]=\lambda\mathbb E\left[W\right]
\end{equation}
\begin{equation}
\mathbb E\left[L_Q\right]=\lambda\mathbb E\left[W_Q\right]
\end{equation}

## Steady State Probabilities

\begin{equation}
P_n=\lim_{t\rightarrow\infty}\mathbb P\left\{L(t)=n\right\}
\end{equation}

Stability
\begin{equation}
a_n=d_n
\end{equation}

Poisson arrivals always see time averages (PASTA):
\begin{equation}
P_n=a_n
\end{equation}

## MM1

Exponential Arrivals / Exponential Services ($\lambda$ / $\mu$)

Markov Chain

A technical remark: if one event occurs at an exponential rate $\lambda$, and another independent event at an exponential rate $\mu$, then together they occur at an exponential rate $\lambda+\mu$.

Steady State

\begin{equation}
\begin{cases}
P_0=1-\frac{\lambda}{\mu}\\
P_n=\left(1-\frac{\lambda}{\mu}\right)\left(\frac{\lambda}{\mu}\right)^n,\quad n>0
\end{cases}
\end{equation}

\begin{equation}
\mathbb E\left[L\right]=\frac{\lambda}{\mu-\lambda}
\end{equation}

\begin{equation}
\mathbb E\left[W\right]=\frac{1}{\lambda}\mathbb E\left[L\right]=\frac{1}{\mu-\lambda}
\end{equation}

\begin{equation}
\mathbb E\left[W_Q\right]=\mathbb E\left[W\right]-\mathbb E\left[S\right]=\frac{\lambda}{\mu\left(\mu-\lambda\right)}
\end{equation}

\begin{equation}
\mathbb E\left[L_Q\right]=\lambda\mathbb E\left[W_Q\right]=\frac{\lambda^2}{\mu\left(\mu-\lambda\right)}
\end{equation}

Finite Capacity?

Exponential Arrivals?

Exponential Services?

Network of Queues?

## GG1

Virtual Waiting Time: $V\left(t\right)$
\begin{equation}
\mathbb E\left[V\right]=\lambda\mathbb E\left[S\right]E\left[W_Q\right]+\frac{\lambda}{2}\mathbb E\left[S^2\right]
\end{equation}

## MG1

Pollaczek–Khintchine formula
\begin{equation}
\mathbb E\left[W_Q\right] = \frac{\lambda\mathbb E\left[S^2\right]}{2\left(1-\lambda\mathbb E\left[S\right]\right)}
\end{equation}

## Statistical Processing

Sample Mean and Sample Variance

\begin{equation}
\bar X = \sum_{i=1}^n X_i
\end{equation}

\begin{equation}
\mathbb E\left[\bar X\right]= \mu
\end{equation}

To determine the “worth” of $\bar X$ as an estimator of the population mean $\mu$, we consider its mean square error:
\begin{equation}
\mathbb E\left[\left(\bar X - \mu\right)^2\right]= \frac{\sigma^2}{n}
\end{equation}

\begin{equation}
S^2=\frac{\sum_{i=1}^n\left(X-\bar x\right)^2}{n-1}
\end{equation}

\begin{equation}
\mathbb E\left[S^2\right]=\sigma^2
\end{equation}

$n$ sufficient large: central limit theorema
\begin{equation}
\mathbb P\left\{\left|X − \mu\right|>c\frac{\sigma}{\sqrt n}\right\} \approx \mathbb P\left\{\left|Z\right|>c\right\}
\end{equation}
where $Z$ is a standard normal

Runtime

Number of Runs

The Regenerative Approach

Stationnarity vs Ergodicity

003fab5783d262bc44a66838ae9cf0c1faa53422
ipynb
Jupyter Notebook
Lectures/Lecture 15.ipynb
JuliaTagBot/ES313.jl
3601743ca05bdb2562a26efd8b809c1a4f78c7b1
MIT
Lectures/Lecture 15.ipynb
JuliaTagBot/ES313.jl
3601743ca05bdb2562a26efd8b809c1a4f78c7b1
MIT
Lectures/Lecture 15.ipynb
JuliaTagBot/ES313.jl
3601743ca05bdb2562a26efd8b809c1a4f78c7b1
MIT
Qwen/Qwen-72B
1. YES
2. YES