\documentstyle{article}
\textwidth 6.5in
\textheight 8.750in
\oddsidemargin -0.1in
\topmargin -0.25in
%\baselineskip=10pt plus 5pt
%\lineskip=10pt
%\lineskiplimit=10pt
\makeatletter
% These allow switching interline spacing; the change takes effect immediately:
\newcommand{\singlespacing}{\let\CS=\@currsize\renewcommand{\baselinestretch}{1}\tiny\CS}
\newcommand{\oneandahalfspacing}{\let\CS=\@currsize\renewcommand{\baselinestretch}{1.25}\tiny\CS}
\newcommand{\doublespacing}{\let\CS=\@currsize\renewcommand{\baselinestretch}{1.5}\tiny\CS}
% Start with double spacing:
\oneandahalfspacing
%\doublespacing
\newtheorem{lemma}{Lemma}
\newtheorem{exmp}{Example}%[chapter]
\newtheorem{dfn}{Definition}%[chapter]
%\newtheorem{asm}{Assumption}%[chapter]
\newcommand{\blob}{\hfill \rule{.1in}{0.1in}}
\newcommand{\beqa}{\begin{eqnarray}}
\newcommand{\eeqa}{\end{eqnarray}}
\newcommand{\beqan}{\begin{eqnarray*}}
\newcommand{\eeqan}{\end{eqnarray*}}
\newcommand{\beq}{\begin{equation}}
\newcommand{\eeq}{\end{equation}}
\newcommand{\prf}{\noindent {\bf Proof}\ \ \ }
\newcommand{\lra}{\Longleftrightarrow}
\newcommand{\lbr}{\left \{ }
\newcommand{\rbr}{\right \} }
\newcommand{\Lbr}{\left [}
\newcommand{\Rbr}{\right ]}
\newcommand{\lp}{\left (}
\newcommand{\rp}{\right )}
\newcommand{\df}{\stackrel{\triangle}{=}}
\newtheorem{theorem}{Theorem}[section]
%\def\baselinestretch{1.5}
\newcommand{\bfl}{\begin{flushleft}}
\newcommand{\efl}{\end{flushleft}}
\newcommand{\bgnv}{\begin{verbatim}}
\newcommand{\ednv}{\end{verbatim}}
\begin{document}
\title{Lecture~5: Implementation Schemes for GPS}
\author{Pramod Viswanath}
\date{30 January 1996}
\maketitle
\section{Introduction}
This lecture focusses on the implementation aspects of the {\em Generalised
Processor Sharing} (henceforth abbreviated to GPS) scheme. Two major
implementations Packet-by-Packet GPS scheme (PGPS) \cite{par-1}, and
Self Clocked Fair Queueing Scheme (SCFQ) \cite{golest} are described and the advantages
and disadvantages of each are discussed. We concentrate on the former
scheme and mention some implementation advantages of the latter while
noting the performance degradation as a tradeoff. In Section~2 we describe
the PGPS scheme and derive some bounds on the difference of the departure
times of packets under PGPS and GPS. In Section~3 we define the concept
of {\em virtual time} and use it to implement PGPS. We also discuss
the computational effort required. Section~4 desribes the SCFQ scheme and
its properties. We conclude with a summary in Section~5.
\section{PGPS scheme}
GPS is an idealized scheme in the sense that it can preempt between
packets and does not transmit packets as entities. PGPS is a packet-by-packet
transmission scheme that closely approximates GPS in performance regardless of
fixed/variable packet size. By convention, we assume that a packet has
arrived only after its last bit has arrived.
Let $F_{p}$ be the time of departure of a packet $p$ under GPS. PGPS is
now defined as a work conserving scheme that serves packets in increasing
order of $F_{p}$. Since PGPS is non idling, it is clear that it cannot
serve all the packets in increasing order of $F_{p}$ unless in the trivial
instance when the packets arrive exactly after each other! We now show
below that the packets that got delayed because PGPS scheduled another
packet that was slated to finish later in GPS are precisely those that
had not arrived {\em early enough}. We also provide an upper bound to
this delay. We first look at an important property of GPS systems.
\begin{lemma}
Let $p$ and $\tilde{p}$ be packets in a GPS system at time $\tau$, and
suppose that packet $p$ completes service before packet $\tilde{p}$ if there
are no arrivals after time $\tau$. Then, packet $p$ will also complete
service prior to $\tilde{p}$ for any pattern of arrivals after time $\tau$.
\end{lemma}
\prf The sessions to which $p$ adn $\tilde{p}$ belong are both backlogged
upto time $\tau$ and by the definition of GPS \cite{par-1}, the ratio of
service received by these sessions is independent of future arrivals.
\hfill \blob
Thus only the departure order is independent of future
arrivals, but it is to be borne in mind that the actual departure times
are clearly dependent on the future arrival pattern. A consequence of this
is that the packets that are delayed more in PGPS than in GPS are precisely those
that arrived too late to be transmitted in their GPS order. The following
result shows that this difference has a nice upper bound.
\begin{theorem}
For all packets $p$,
\beq
\hat{F_{p}} - F_{p} \leq \frac{L_{\mbox{max}}}{r}
\label{bound-lmax}
\eeq
where $L_{\mbox{max}}$ is the maximum packet length, $r$ is the rate of
the server and $\hat{F_{p}}$ is the time at which packet $p$ departs under
PGPS.
\end{theorem}
\prf The proof is as in Theorem~1 of \cite{par-1}. Here we comment on the
ideas involved in the proof. Since both GPS and PGPS are non-idling, their
busy periods coincide and it is thus
sufficient to derive the bound over each busy period. Let $t_{k}$ and
$u_{k}$ denote the departure times of a packet $p_{k}$ under PGPS and
GPS respectively. Let $a_{k}$ be its arrival time. Let $m$ be the largest integer
such that $0 < m \leq k-1$ and $u_{m} > u{k}$. If $ m = 0$, then all the
packets packets indeed leave the PGPS server in the same order as GPS, and
hence $u_{k} \geq t_{k}$. Suppose $m \neq 0$. Then, it is seen in \cite{par-1}
that
\beq
t_{k} \leq u_{k} + \frac{L_{\mbox{max}}}{r}
\eeq
This proof is based on Lemma~1 above. \hfill \blob
It should be noted that we are only bounding the extra delay a packet
will face in PGPS as compared to GPS. It is significant that the bound is independent of the number of sessions. It can be seen that the bound in the
other direction, namely, {\em graciousness} of PGPS in serving earlier than
under GPS is lower bounded by $(N-1) L_{\mbox{max}}$; clearly we are
uninterested in this bound! Succinctly, Theorem~2.1 says that the delay under
PGPS compared to GPS can be utmost that of serving a packet of maximum
length. With this in the background it shouldnt be surprising to expect
the following result:(Theorem~2, \cite{par-1}).
\beq
S_{i}\lp 0, \tau \rp - \hat{S_{i}} \lp 0, \tau \rp \leq L_{\mbox{max}},
\; \; \forall \mbox{ times } \tau \mbox{ and sessions } i
\eeq
Thus in any time interval the amount served for any session $i$ by PGPS
can differ from that by PGPS by utmost the maximum size of {\em one} packet.
These results confirm that PGPS is an excellent approximation to GPS. The
next section describes a scheme to implement PGPS.
\section{Virtual Time Implementation of PGPS}
We define {\em virtual time} $v(t)$ as a non-decreasing and piecewise linear
function of time. Let an {\em event} denote each arrival and departure from the
GPS server and $t_{j}$ be the time of occurrence of the $j^{th}$ event.
The slope of $v$ is fixed in each time interval $\lp t_{j-1}, t_{j} \rp$
and is equal to
\beq
\frac{r}{\sum_{i \in \cal{B}_{j}} \phi_{i}}
\eeq
where $\cal{B}_{j}$ is the set(fixed) of sessions busy in
$\lp t_{j-1}, t_{j} \rp$. It is clear that $v(\cdot) \; \nearrow$
and hence the virtual finishing
time ordering of the packets is the same as the ordering of $F_{p}$. $v(\cdot)$ can be interpreted as the marginal rate at which the backlogged sessions
receive service. With this, we can now write a recursive equation to compute
the virtual finishing times of the packets.
Let the arrival time of $k^{th}$ session $i$ packet be $a_{i}^{k}$ and
have length $L_{i}^{k}$. Let the virtual times at which this packet
begins and completes service be $S_{i}^{k}$ and $F_{i}^{k}$ respectively.
Then,
\beqa
S_{i}^{k} & = & \max \lbr F_{i}^{k-1}, V \lp a_{i}^{k} \rp \rbr \\
F_{i}^{k} & = & S_{i}^{k} + \frac{L_{i}^{k}}{\phi_{i}}
\eeqa
with the initial value $F_{i}^{0} = 0, \forall i$. We notice that the
virtual finishing time can be stamped on the packet as soon as it arrives
provided that the function $v(\cdot)$ is kept track of. To keep track of
$v(\cdot)$ one needs to keep track of the set of busy sessions in each
interval $\lp t_{j-1}, t_{j} \rp$, since this decides the slope of $v(\cdot)$
in the interval. This is the computational price to be paid as overhead
to maintain the virtual time function. This computation can turn out to
be very expensive since GPS allows packets to finish almost simultaneously.
This motivates the development of a scheme that reduces this computational
burden. One such scheme is the focus of the next section.
\section{Self Clocked Fair Queueing Scheme SCFQ}
This scheme, as outlined in \cite{golest} uses an approximation of
the virtual time function $v(\cdot)$ and escapes the computational burden
of maintaining the set of busy sessions. Here, the virtual time is defined
as a piecewise constant function. The value within any interval $\lp t_{j-1}, t_{j} \rp$ is a constant and equal to the virtual finishing time of
the packet in service in that time interval. Formally, with the notation as
before, the virtual time update is as below:
\begin{enumerate}
\item For each session $i$,
\beq
\tilde{F}_{i}^{k} = \frac{L_{i}^{k}}{r} + \max \lp \tilde{F}_{i}^{k-1}, \hat{v} \lp a_{i}^{k} \rp \rp
\eeq
\item $\hat{v}(t)$ is the virtual time under SCFQ computed as
\beq
\hat{v}(t) \stackrel{\Delta}{=} \hat{F}_{j}^{l}, \; \; \; s_{j}^{l} < t < d_{j}^{l}
\eeq
where $s_{j}^{l}$ and $d_{j}^{l}$ are the starting and finishing times
of service of the $l^{th}$ packet of session $j$.
\end{enumerate}
\cite{golest} demonstrates
the fairness of this scheme in a different setting. However, with our
idea of fairness as in Section~3, this scheme fails as illustrated by the following
example which shows that:
\beq
\tilde{F}_{p} - F_{p} > \frac{(N-1)L_{\mbox{max}}}{r}, \; \; N = \mbox{number of sessions}
\eeq
This is to be contrasted with the bound $\hat{F}_{p} - F_{p} \leq \frac{L_{\mbox{max}}}{r}$ we had in PGPS.
Let $\phi_{1} = 0.5$ and $\phi_{i} = \frac{1}{2N}, \; i = 2 \ldots N+1$. Let
the packet length be a constant $L$ and the server rate be $r$. AT $t=0$,
a packet from each of the sessions with weights $\frac{1}{2N}$ arrive. So,
all of them have a virtual finish time tag of $\frac{L}{1/2N} = 2NL$. At time
$t=0^{+}$, let a session 1 packet arrive. Then its virtual finish time
tag is $2NL + \lbr L / 0.5 \rbr = 2(N+1)L$.
So, the actual time of departure of the session 1 packet is
\beq
\tilde{F}_{p} = N \times \frac{L}{r} + \frac{L}{r} = (N+1) \frac{L}{r}
\eeq
The time of departure in GPS is however
\beq
F_{p} = \frac{L}{0.5r} = \frac{2L}{r}
\eeq
Hence, $\tilde{F}_{p} - F_{p}$ is atleast $(N-1) \frac{L}{r}$, proving
our result. \hfill \blob
\section{Conclusions}
We have studied two implementations of GPS, and analysed their performance.
Overall, GPS guarantees end-end delay bounds for services independent of
the other services. Thus given $\phi_{i}$, these bounds are calculated
and is independent of the admission control. However the disadvantages lie
in the computational complexity in computing the virtual time.
\begin{thebibliography}{9}
\bibitem{par-1} Abhay K. Parekh and Robert G. Gallager, ``A Generalized Processor
Sharing Approach to flow control in Integrated Services Networks, Part I'',
{\em IEEE/ACM Transactions on Networking}, Vol.1, No.3, June 1993.
\bibitem{golest} S.Jamaloddin Golestani, ``A Self-Clocked fair queueing scheme
for broadband applications'', BellCore, AT\&T Research Labs.
\end{thebibliography}
\end{document}