\documentclass[landscape]{slides}
\usepackage{multicol}
\usepackage[all,poly,ps,dvips,color]{xy}
\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, Lecture 16}

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

\date{}
\maketitle

\end{titlepage}


\begin{SLIDE}[Class Outline]


\begin{itemize}
\item Presentations
\item The Free Rider Problem
\item Informers
\item Using Informers to Restrain Free Riders
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[Class Presentations]

\begin{itemize}
\item Each student will give a 30 minute presentation
\item By October 29th (today), you must speak to me (in office hours
or by appointment) about your proposed presentation.
\item Aaron - Max Cut in Random Graphs, Vishal - Tutte's Thm?, Jun -
Online Machine Learning
\item By November 5th, you must turn in a 1 page detailed summary of
what you will present.  Give a description of the abstract problem,
the algorithm(s), and all major theorems (you should try to prove no
more than 1 or 2 theorems).
\item Class Presentations will be given on November 19, 21 and 26th -
choose a date now.
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[Class Presentations (II)]
\begin{itemize}

\item The presentation should be on an algorithmic approach to a
``real-world'' problem or on a mathematical tool that is useful for
real-world algorithms

\item There should be some ``mathematical meat'' to your
presentation.  In particular, there should be some use of mathematical
tools like the ones we learned in class (e.g. graph theory,
probability theory, online analysis, etc.)

\item It's ok to present in groups of up to $3$ people

\item Find something that interests you!!!

\end{itemize}
\end{SLIDE}


\begin{SLIDE}[Presentation Signup]
\begin{itemize}
\item 11/19 Vinay and Jijun
\item 11/21 Ravi and Vishal 
\item 11/26 Jun and Aaron
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[``Free Rider'' Problem]

\emph{The ``Three'' ruled with the help of an elaborate network of
agents and informers.  The city was divided up, with a set number of
informers for each ward and parish - Donald Phau in ``Venice: The Methodology of Evil''}

\begin{itemize}
\item The problem: how can we enforce good social behavior for peers?
\item Question: What is ``good social behavior''?
\item More generally: how can we maintain ``law and order'' on the p2p frontier?
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[What is ``good social behavior''?]
\begin{itemize}
\item ``Good social behavior'' varies by context
\item In a large p2p system for sharing music, may only need small
number of peers to contribute content and resources
\item In a more specialized p2p system (e.g. sharing genetic
sequencing data among researchers), may want all of the peers to share
some of their resources
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[What can we hope for?]
\begin{itemize}
\item Recall that the peer-to-peer graph is sparsely connected -
typically no more than $O (\log n)$ neighbors per peer
\item Hence any single peer, can collude with all its neighbors and
get away with bad social behavior
\item We can really only hope to enforce the law for ``most'' of the peers
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[Informers]
\begin{itemize}
\item A key idea: Let the peers ``inform'' on each other
\item Each peer, in addition to playing its normal roles in the
network, also plays the role of informing on a fixed number of other peers
\item All communication that any peer has with the p2p network first
passes through the informers for that peer.
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[Informers]
\begin{itemize}
\item Some of the informers will be untrustworthy
\item They may try to collude to let bad peers get away with things
\item They may try to collude to unfairly punish good peers
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[Handling ``Bad'' Informers]
We use the following tools to handle bad informers:
\begin{itemize}
\item Require a large number of informers - massive redundancy
\item Informers are assigned ``at random'' to inform on someone
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[Random Assignment of Informers]
\begin{itemize}
\item Since there is no centralized authority, getting a random
assignment is tricky
\item Improper that peers perform the random selection themselves since
\item 1) ``bad'' informers could all assign themselves to some ``bad''
peer and thus protect that peer
\item 2) ``bad'' informers could all assign themselves to some
``good'' peer and thus punish that peer unfairly
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[Unique ID]
\begin{itemize}
\item In order to have any hope of success, each peer must have a
  unique, verifiable id determined by some outside authority
\item This id could be the ip-address of the peer
\item Without such id's, it's possible for one bad peer to pretend
  that it is a very large number of separate peers and thus take over
  the network
\item For a peer $p$, let $i_{p}$ be the unique id for $p$
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[Random Assignment]
\begin{itemize}
\item Let $n$ be the total number of peers in the network
\item We make use of a ``random oracle'' function $f$ which maps $Z$
to $\{0,\dots ,n \}^{\textrm{polylog (n)}}$
\item This function essentially maps integers to random tuples of
length $\textrm{polylog (n)}$ over the set $\{1,\dots ,n \}$
\item For a peer $p$ with id, $i_{p}$, $f(i_{p})$ will give the ids of
the informers of $p$
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[Join Protocol for joining peer $p$]

\begin{itemize}
\item $p$ broadcasts message that $i_{p}$ is joining to all peers in network
\item Let $S$ be the set of peers $p$ receives replies from that claim
to be $p$'s informers.  Let $S'$ be the set of verified informer in
$S$ (i.e. $S' = \{s \in S | i_{s} \in f(i_{p}) \}$ 
\item $p$ sets it's informer set $I(p)$ to be $S'$
\item $p$ establishes connections with all peers in $I(p)$
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[Join Protocol for non-joining peer $o$]
\begin{itemize}
\item $o$ receives join message from $p$ and obtains $p$'s id, $i_{p}$
\item If $i_{o} \in f(i_{p})$, $o$ broadcasts a claim that it is an
informer for $p$ to all other peers.  It also adds $p$ to its
informant set, $I^{-1}(o)$
\item $o$ receives messages from all peers which claim to be informers
for $p$.  Let $I(p)$ be the verified set of all such peers
\item Let $I^{-1}(o)$ be the set of peers that $o$ informs on.  For
each $x \in I^{-1}(o)$ such that $(x,p)$ is an edge in the underlying
network, $o$ establishes an informer-to-informer link to each peer in $I (p)$
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[Fail-stop faults]
\begin{itemize}
\item First consider the situation where bad peers suffer
``fail-stop'' faults
\item Recall ``fail-stop'' means that bad informers simply stop communicating
\item We give a very light-weight scheme for informing and
communicating through the network in this case
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[Communication: Peer to Informer]
\begin{itemize}
\item Peer protocol: When a peer $p$ requests a data item or serves a
data item, it sends out a message to a random informer in $I(p)$
\item Informer protocol: When an informer receives a message from its
peer, it does the following
\begin{itemize}
\item If the message is a data item requested by a previously logged
request, it logs this response and broadcasts information on the
response to all other informers in $I(p)$
\item Otherwise, with probability $p_{i}$, it logs information on the
message sent out and broadcasts this information to all other peers in $I(p)$
\item Finally, it sends the message to the next appropriate informer
cloud using the protocol described under \emph{Informer to Neighboring
Informer Cloud}
\end{itemize}
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[Informer to Peer]
\begin{itemize}
\item When an informer receives a message to its peer, it does the
following:
\item If the message is a request for data, with probability $p_{i}$,
it logs information on the request and broadcasts this information to
all other informers in the informer cloud.
\item Next, it sends the message to the peer
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[Informer to Neighboring Informer Cloud]
\begin{itemize}
\item When an informer has a message which is to be sent to a
neighboring informer cloud, it does the following:
\item Until it gets a response, it chooses a random informer in the
neighboring informer cloud and pings that informer
\item Once a live informer is found, the message is sent to that live informer
\end{itemize}
\end{SLIDE}


\begin{SLIDE}[Analysis]
\begin{itemize}
\item Let $p_{f}$ be the ratio of the number of failed peers to the
total number of peers
\item Assume we want to communicate a message from some peer $a$ to
some peer $b$ in the original network
\item Let $p_{i}$ be any number in the range $0$ to $1$ 
\item Let $m$ be the number of informers in each informer cloud ($m$
is polylog in $n$)
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[Analysis]
Theorem: The above protocol allows for communication along the path
from $a$ to $b$ such that
\begin{itemize}
\item The message sent from $a$ is known by all peers in $I(a)$ with
probability $p_{i}$, and is known to all peers in $I(b)$ with
probability $p_{i}$
\item The expected time to send the message is $(1/p_{f})l + 2*p_{i}$
\item The expected number of messages sent is $(1/p_{f})l + 2*p_{i}*m$
\item The time to send and number of messages to send are sharply
concentrated around their expected values
\end{itemize}
\end{SLIDE}

\end{document}
