\documentclass[landscape]{slides}
\usepackage{multicol}
 
\input{preamble}
\input{SLIDES}
 
%\usepackage[dvips]{graphics}
%\usepackage[all,poly,ps,dvips,color]{xy}
%\UseCrayolaColors

%\DeclareMathOperator{\mathin}{in}
%\DeclareMathOperator{\mathout}{out}

\newcommand{\vindex}[2]{\left[ #1 \right] _ #2}
\newcommand{\eigen}{\mathbf a}
\newcommand{\elem}{\mathbf e}
\newcommand{\state}{\mathbf x}
\newcommand{\maxdeg}{\Delta}
\newcommand{\maxdegC}{d_{max}}

\newcommand{\din}{d_{\mathin}}
\newcommand{\dout}{d_{\mathout}}
\newcommand{\dmax}{d_{\max}}


\newcommand{\nlabel}[2]{\ar@{} @(#1,#1) |<<{#2}}
\newcommand{\gnlabel}[2]{[#1(.25)] {#2}}
\newcommand{\node}{{\bullet}}
\newcommand{\bypass}{{\circ}}

\begin{document}

\begin{titlepage}
\title{CS 591-06, Lecture 11}

\author {Jared Saia \\
{\red University of New Mexico}}

\date{}
\maketitle

\end{titlepage}

\begin{SLIDE}[Class Outline]
\emph{A reasonable probability is the only certainty.} - E.W. Howe

\begin{itemize}
\item Review Chernoff Bounds
\item In-Class Exercise
\item The Akamai Problem
\item The Akamai Solution
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[Chernoff Bounds]
\begin{itemize}
\item Let $X=\sum _{i=1}^{m}X_{i}$ where the $X_{i}$ are random variables which
are: independent and all take on values between $0$ and $1$.
\end{itemize}
then for any $0<\delta \leq 1$,
\begin{itemize}
\item $P (|X - E (X)| \geq \delta E (X) ) \leq 2e^{\frac{-E (X) \delta
^{2}}{4}}$
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[Some Useful Bounds]

\begin{itemize}
\item Stirlings Formula: $n! = \sqrt{2\pi n} \left( \frac{n}{e} \right)^{n} \left( 1+\frac{1}{12n} + O (\frac{1}{n^{2}})\right)$ 

\item $n! \geq  \left( \frac{n}{e} \right)^{n}$

\item ${n \choose {k}} \leq \frac{n^{k}}{k!}$

\item ${n \choose {k}} \leq \left(\frac{ne}{k} \right)^{k}$

\end{itemize}
\end{SLIDE}


\begin{SLIDE}[In Class Exercise]
\begin{itemize}
\item Consider a directed random graph with possible loops on $n$
vertices where each of the $n^{2}$ possible edges is included with
probability $p$.

\item Q: What is the expected number of edges shared between any set
of $n/2$ vertices?

\item Q: What is the probability that some fixed set of $n/2$
vertices share more than $n^{2}p/2$ edges?

\item Q: What is an upperbound on the probability that the graph
contains \emph{some} set of $n/2$ vertices which share $n^{2}p/4$ edges?

\end{itemize}
\end{SLIDE}



\begin{SLIDE}[The Congestion Problem]

The WWW suffers from distribution delays.  Two causes of delays:
\begin{itemize}
\item Congested Networks
\item Swamped servers
\end{itemize}

Servers and networks can be swamped unexpectedly (e.g. ``cool site of
the day'' phenomena)

\end{SLIDE}

\begin{SLIDE}[Solution to Congestion]
\begin{itemize}
\item Caching is the solution to the congestion problem
\item Nearby cache can serve a page quickly even if page source is swamped
\item Good for the users and good for the group
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[Naive Approach]
\begin{itemize}
\item Naive Approach: Provide a group of users with a single shared
cache machine
\item Problem: if cache fails, all users are cut off
\item Problem: a single cache can be a bottleneck
\item Problem: Storage space of a single cache is limited so suffers
false misses
\item Problem: Limited number of users means limited amount of
aggregated requests
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[Cooperative Caching]


\begin{itemize}
\item Cooperative Caching: Every client has one \emph{primary cache}.
If the request misses there, the client tries to locate the page in
other cooperating caches.
\item + : fault tolerance, scalability and request aggregation
\item - : consumes excess bandwidth and requires data duplication
\end{itemize}

\end{SLIDE}


\begin{SLIDE}[Akamai Approach]
\begin{itemize}
\item Hash-based scheme - \emph{consistent hashing}
\item A user requesting a page contacts only the one cache responsible
for that page, no inter-cache communication
\item + : less communication overhead per page request, discovers
misses quickly, reliable
\item - (?) : requires mathematical tools to develop the hashing scheme
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[Hashing]
\begin{itemize}
\item Goal: Let any client hash a URL to a particular cache containing
that URL
\item Naive Approach: Hash URL u to cache via function $h (u) = 7u + 4
(mod 23)$
\item Problem1: What happens when a 24th cache is added to the system?
(If we change to new function $h' (u)= 7u + 4 (mod 24)$, then
essentially every URL is mapped to a different cache.)
\item Problem2: What happens if all of the clients have different
ideas of which servers are available
\end{itemize}

\end{SLIDE}





\end{document} 

