sync: XMPP Serverless Messaging
[skm-ma-ws1314.git] / xmpp.tex
index 44f16b0..7bef910 100644 (file)
--- a/xmpp.tex
+++ b/xmpp.tex
@@ -22,10 +22,10 @@ the resource is only needed for routing between client and server.
 \subsubsection{Architecture}
 \begin{wrapfigure}{r}{0.4\textwidth}
 %\begin{figure}[htop]
-  \label{fig:xmpparch}
   \centering
   \includegraphics[width=0.4\textwidth]{xmpp-architecture-mock.jpg}
   \caption{XMPP architecture}
+  \label{fig:xmpparch}
 %\end{figure}
 \end{wrapfigure}
 
@@ -68,23 +68,54 @@ other side then has the chance to send all outstanding stanzas and likewise
 closes its stream. If both streams are closed, the underlying TCP connection is
 terminated.
 
-\todo{Example stream}
+\todo[Example stream]
 
 \subsubsection{Multi-User Chats}
 
 \cite{xep-0045}
 
-\subsubsection{Publish/Subscribe and the Roster}
+\subsubsection{Publish/Subscribe, Presence and the Roster}
 
 \cite{xep-0060}
 
-\subsubsection{Presence}
 
-
-\cite{rfc6120}
+\cite{rfc6121}
 
 \subsubsection{XMPP Serverless Messaging}
 \todo
-\cite{xep-0174} \pages{1}
+
+To overcome the need for a central server and authentication, XMPP Serverless
+Messaging~\cite{xep-0174} allows XMPP clients on a network to build a
+peer-to-peer mesh network and chat directly with each other. This feature was
+first introduced by Apple as part of their \term{Bonjour} project, and nowadays
+it is also available in many other XMPP clients.
+
+With XMPP Serverless Messaging, XMPP clients simply open a port on the host, and
+then rely on mDNS and DNS-SD (see Section~\ref{sec:dns})
+to publish instance names in the domain \code{\_presence.\_tcp.local}. For
+example, if Juliet uses her machine (named \code{capulet}) with serverless
+messaging, her client would publish the following four mDNS records:
+
+\begin{itemize}
+  \item an A record \code{capulet.local}, specifying her IP address,
+  \item an SRV record \code{juliet@capulet.\_presence.\_tcp.local}, specifying
+    the port on which her XMPP client listens, and refering to
+    \code{capulet.local} as the host name
+  \item a PTR record \code{\_presence.\_tcp.local} for service discovery,
+    pointing to \code{juliet@capulet.\_presence.\_tcp.local}
+  \item and a TXT record \code{juliet@capulet.\_presence.\_tcp.local} specifying
+    more information about her (e.~g. her online status, contact data, etc.)
+\end{itemize}
+
+When other clients in the same network enumerate the available services by
+querying \code{\_presence.\_tcp.local}, they notice Juliet's presence and add
+her to the roster automatically. In that way, XMPP users can see who is
+currently available for communication. To start a chat session, clients initiate
+a TCP connection over the advertised ports, open their XML streams, and send
+message or IQ stanzas like they would to an XMPP server. Presence is managed
+over the corresponding TXT record in the mDNS. To go offline, a client
+announces the deletion of its mDNS records.
+
+\pages{1}
 
 % vim: set ft=tex et ts=2 sw=2 :
This page took 0.026163 seconds and 4 git commands to generate.