\documentstyle[11pt,psfig]{article}
\setlength{\parskip}{2 ex}
\setlength{\topmargin}{-0.5 in}
\setlength{\oddsidemargin}{0 in}
\setlength{\textheight}{9.0 in}
\setlength{\textwidth}{6.5 in}
\renewcommand{\today}{}
\begin{document}
\large
\centerline{\bf Fall'06}
\centerline{\bf Computer Networks}
\centerline{\bf TelCom 2310}
\centerline{http://www.cs.pitt.edu/$\sim$znati/tel2310.html}
\vskip .1in
\vskip .1in
\centerline{{\Large\bf Homework 2 Solution}}
\normalsize


\section* {Problem 1}

Assume that packets arrive at a node to be transmitted. The packets arrive
at random times $T_1$, $T_2$, $\cdots$, $T_n$, $\cdots$, and are
transmitted in the order of their arrivals (FIFO).

\begin{enumerate}
\item The diagram showing how many bits are stored
in the node buffer as a function of time is depicted in Figure \ref{diag}.

\begin{figure}[htbp]
\centerline{\psfig{figure=diagram.eps,height=2.6in,width=3.25in}}
\caption{Number of bits, N(t), in the buffer at time t}
\label{diag}
\end{figure}

\item  Let $D_n$ denote the delay faced by the $n$-th packet. We
have $D_n = \frac{N(T_n)}{R}$. For packet $1$, $D_1 = \frac{P}{R}$, since
$N(T_1) = P$. To identify $D_2$, we observe that the queing time
of the second packet is equal to the residual transmission time
of the first packet, i.e., $\max \left ( D_1 - (T_2 - T_1), 0 \right )$.
Consequently, we have:

\begin {equation}
 D_2 = \max \left ( D_1 - (T_2 - T_1), 0 \right ) + \frac{P}{R}.
\end {equation}

In general, we find that:

\begin {equation}
 D_{n+1} = \max \left ( D_n - (T_{n+1} - T_n), 0 \right ) + \frac{P}{R}.
\end {equation}

\item To show that large average queueing delays can oocur, even with
low average arrival rate, consider batches of $k$ packets that
arrive every $T$ seconds. We choose $T$ larger than $\frac{kP}{R}$ so that
the successive batches find the buffer empty. The first packet of
a batch has a delay  $D_1 = \frac{P}{R}$, the second packet
has a delay $D_2 = \frac{2P}{R}$, and so on. The $k$-th packet in
a batch has a delay $D_k = \frac{kP}{R}$. Thus the average
delay per packet is $\frac{(D_1 + D_2 + \cdots + D_k)}{k} = \frac{(k+1)P}{2R}$.
By choosing $k$ large, we can make the average delay large, even
when $T$ is so large that the average packet arrival rate $\frac{k}{T}$
is very small.
\end{enumerate}


\end{document}
