From: Roland Hieber Date: Fri, 13 Dec 2013 04:03:12 +0000 (+0100) Subject: sync: xmpp communication primitives, dns-sd, outline for comparison. mock images... X-Git-Tag: erste-version~9 X-Git-Url: https://git.rohieb.name/skm-ma-ws1314.git/commitdiff_plain/db175969734f2fc4b583278d25760fdd690df02a?ds=sidebyside sync: xmpp communication primitives, dns-sd, outline for comparison. mock images: more contrast --- diff --git a/.gitignore b/.gitignore index 272171e..c1d674f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ *.fdb* *.log *.pdf +*.out diff --git a/biblio.bib b/biblio.bib index 2feee3b..7f1a489 100644 --- a/biblio.bib +++ b/biblio.bib @@ -12,7 +12,7 @@ @misc{xep-0174, abstract = "This specification defines how to communicate over local or wide-area networks using the principles of zero-configuration networking for endpoint discovery and the syntax of XML streams and XMPP messaging for real-time communication. This method uses DNS-based Service Discovery and Multicast DNS to discover entities that support the protocol, including their IP addresses and preferred ports. Any two entities can then negotiate a serverless connection using XML streams in order to exchange XMPP message and IQ stanzas.", author = "Saint-Andre, Peter", - howpublished = "http://xmpp.org/extensions/xep-0174.html", + howpublished = "\url{http://xmpp.org/extensions/xep-0174.html}", month = nov, organization = "{XMPP Standards Foundation}", series = "{XMPP Extension Protocols}", @@ -63,7 +63,6 @@ author = "Gulbrandsen, A. and Vixie, P. and Esibov, L.", howpublished = "RFC 2782 (Proposed Standard)", month = feb, - note = "Updated by RFC 6335", number = "2782", organization = "Internet Engineering Task Force", publisher = "IETF", @@ -76,7 +75,7 @@ @misc{draft-ietf-core-coap-18, author = "Shelby, Z. and Hartke, K. and Bormann, C.", edition = "18", - howpublished = "https://tools.ietf.org/html/draft-ietf-core-coap-18", + howpublished = "\url{https://tools.ietf.org/html/draft-ietf-core-coap-18}", month = jun, organization = "Internet Engineering Task Force", publisher = "IETF", @@ -114,7 +113,7 @@ @misc{mqtt, author = "{IBM}", edition = "{v3.1 Specification}", - howpublished = "http://www.ibm.com/developerworks/webservices/library/ws-mqtt/", + howpublished = "\url{http://www.ibm.com/developerworks/webservices/library/ws-mqtt/}", organization = "{IBM}", title = "{MQ Telemetry Transport}" } @@ -152,7 +151,7 @@ @misc{xep-0060, abstract = "This specification defines an XMPP protocol extension for generic publish-subscribe functionality. The protocol enables XMPP entities to create nodes (topics) at a pubsub service and publish information at those nodes; an event notification (with or without payload) is then broadcasted to all entities that have subscribed to the node. Pubsub therefore adheres to the classic Observer design pattern and can serve as the foundation for a wide variety of applications, including news feeds, content syndication, rich presence, geolocation, workflow systems, network management systems, and any other application that requires event notifications.", author = "Millard, Peter and Saint-Andre, Peter and Meijer, Ralph", - howpublished = "http://xmpp.org/extensions/xep-0060.html", + howpublished = "\url{http://xmpp.org/extensions/xep-0060.html}", month = jul, organization = "{XMPP Standards Foundation}", series = "{XMPP Extension Protocols}", @@ -163,7 +162,7 @@ @misc{xep-0045, abstract = "This specification defines an XMPP protocol extension for multi-user text chat, whereby multiple XMPP users can exchange messages in the context of a room or channel, similar to Internet Relay Chat (IRC). In addition to standard chatroom features such as room topics and invitations, the protocol defines a strong room control model, including the ability to kick and ban users, to name room moderators and administrators, to require membership or passwords in order to join the room, etc.", author = "Saint-Andre, Peter", - howpublished = "http://xmpp.org/extensions/xep-0045.html", + howpublished = "\url{http://xmpp.org/extensions/xep-0045.html}", month = feb, organization = "{XMPP Standards Foundation}", series = "{XMPP Extension Protocols}", diff --git a/dns-extensions.tex b/dns-extensions.tex index 1bb5ac0..bf8bdc8 100644 --- a/dns-extensions.tex +++ b/dns-extensions.tex @@ -1,9 +1,10 @@ \subsection{Extensions to the DNS protocol} \subsubsection{Multicast DNS} -\term{Multicast DNS}~\cite{rfc6762} (mDNS) describes an extension of the Domain Name -System that allows DNS resource records to be distributed on multiple hosts in a -network, therefore avoiding the need of a central server. + +\term{Multicast DNS}~\cite{rfc6762} (mDNS) describes an extension of the Domain +Name System that allows DNS resource records to be distributed on multiple hosts +in a network, therefore avoiding the need of a central server. Software that supports resolution of mDNS records listens on the reserved link-local multicast address \code{224.0.0.251} (for IPv4 queries) or @@ -22,18 +23,45 @@ than one host (e.~g., SRV records). The hosts matching those resources then do not generate a response. Finally, hosts may also send unsolicited responses. This can be used to notify -the network of new services available on the host. +the network of new services available on a host. \pages{1} -\subsubsection{DNS-Based Service Discovery} -\todo -\term{DNS-based Service Discovery} \cite{rfc6763} -\begin{itemize} - \item allows flexible mapping of available services to ports - \item utilization of SRV \cite{rfc2782}, TXT and PTR records - \item case study for IoT in \cite{Klauck:2012:BCC:2352852.2352881} -\end{itemize} +\subsubsection{DNS-Based Service Discovery}\label{sec:dnssd} + +As a recent extension for the Domain Name System, \term{DNS-Based Service +Discovery (DNS-SD)}~\cite{rfc6763} uses DNS records of type +\code{SRV}~\cite{rfc2782} and \code{PTR} in a way that allows hosts to browse +for services in a domain. As an example, Figure~\ref{fig:dnssd} shows the +process of browsing for all XMPP clients in the domain \code{example.org}. +This is a two-step process, consisting of \term{Service Instance Enumeration} +and \term{Service Instance Resolution}. + +\begin{figure}[htop] + \centering + \includegraphics[width=0.9\textwidth]{dnssd-mock.jpg} + \caption{DNS-SD: Service Instance Enumeration and Resolution} + \label{fig:dnssd} +\end{figure} + +\paragraph{Service Instance Enumeration} At first, to enumerate the available +services in a domain for a given protocol, a DNS-SD-enabled client queries +resources of type \code{PTR} of the form \code{\_service.\_proto.domain}. The +result of this query is then a list of \term{instance names} of the form +\code{name.\_service.\_proto.domain} which provide the specified service. For +example, in Figure~\ref{fig:dnssd}, all XMPP clients in the domain +\code{example.org} are enumerated, and as a result, the instance names of three +hosts are returned. + +\paragraph{Service Instance Resolution} As a second step, the returned instance +names are resolved as \code{SRV} records to retrieve the actual host names and +port numbers of a service. In the example, resolution of one instance name shows +that an XMPP client is running at host \code{juliet.example.org} on port 5222. + +Through the usage of \code{SRV} records, it is easily possible for a service to +inform clients about non-standard port numbers, and especially in connection +with Multicast DNS makes it easy to deploy decentralized systems for the +Internet of Things~\cite{Klauck:2012:BCC:2352852.2352881}. \pages{1} % vim: set ft=tex et ts=2 sw=2 : diff --git a/dnssd-mock.jpg b/dnssd-mock.jpg new file mode 100644 index 0000000..9d90ecb Binary files /dev/null and b/dnssd-mock.jpg differ diff --git a/main.tex b/main.tex index 1b3120a..9d8854c 100644 --- a/main.tex +++ b/main.tex @@ -5,6 +5,7 @@ \usepackage{color} \usepackage{graphicx} \usepackage{wrapfig} +\usepackage{hyperref} \newcommand{\pages}[1]{\marginpar{#1 pages}} \newcommand{\todo}{\textcolor{red}{TODO} \\} @@ -26,13 +27,13 @@ Masses with XMPP} short overview, not too long: what do we want, what are we going to do +basically: how do we talk to our smart home? %% Prerequisites \section{Prerequisites} \todo overview to the techniques used in the paper by Klauk and Kirsche -basically: how do we talk to our smart home? \cite{klauck-kirsche-chattythings} \input{address-allocation.tex} @@ -52,8 +53,36 @@ basically: how do we talk to our smart home? Middleware, Application protocol gateways: \begin{itemize} \item Constrained Application Protocol \cite{draft-ietf-core-coap-18} + \begin{itemize} + \item machine-to-machine + \item everything-built-in + \item discovery over multicast, service discovery over /.well-known + entry-point + \item maps to HTTP => stateless + \item low protocol overhead and parsing complexity (binary messages) + \item only draft status + \item UDP with Ack and IDs instead of TCP... (limited state machine) + \item proxies + \item asynchronous messages + \end{itemize} \item MQ Telemetry Transport \cite{mqtt} + \begin{itemize} + \item TCP/IP + \item small overhead: 2 byte header + variable header length + \item publish-subscribe with topic names + \item binary protocol + \item discovery? + \end{itemize} \item Devices Profile for Web Services \cite{zeeb-moritz-ws4d} + \begin{itemize} + \item TCP/IP -> HTTP -> SOAP -> Web Services. Overhead! + \item but very extendable and composable + \item discovery as a service + \item focused on multiple platforms, deeply embedded and servers + \item IPv6 partly experimental + \item ROM usage of uDPWS: 45 kByte + \end{itemize} + \end{itemize} \section{Discussion} diff --git a/xmpp-architecture-mock.jpg b/xmpp-architecture-mock.jpg new file mode 100644 index 0000000..dcaaec1 Binary files /dev/null and b/xmpp-architecture-mock.jpg differ diff --git a/xmpp.tex b/xmpp.tex index b4dc98a..44f16b0 100644 --- a/xmpp.tex +++ b/xmpp.tex @@ -22,6 +22,7 @@ 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} @@ -29,11 +30,11 @@ the resource is only needed for routing between client and server. \end{wrapfigure} The original architecture underlying XMPP strongly leans on the established -design of Internet Mail. The distributed network is formed by \term{XMPP -servers} on one hand, which make up the always available backbone of the network -and manage user accounts and statuses, and \term{XMPP clients} on the other -hand, which represent a single logged-in user and make up the interface for -communication with other users. +design of Internet Mail, and an example is depicted in Fig.~\ref{fig:xmpparch}. +The distributed network is formed by \term{XMPP servers} on one hand, which make +up the always-on backbone of the network used for routing message, and manage +user accounts and statuses. On the other hand, \term{XMPP clients} represent a +single logged-in user and are the interface for communication with other users. Every client communicates only with the server that manages the respective user account which is configured in the client, as given in the user's JID. The @@ -43,34 +44,44 @@ sends the message to a client where the receiving JID is logged in. If the user is not logged in at the time the message is sent, the server can store it for the user and deliver it on the next login. -\todo{use of DNS-SD?} +XMPP strongly relies on DNS Service Discovery (see Section~\ref{sec:dnssd}) to +determine the server being in charge of a domain. For example, the server who +manages the users for the domain \code{example.org} is given by the SRV record +\code{\_xmpp-server.\_tcp.example.org}. \subsubsection{Communication primitives} +All communication over XMPP is based on XML. To minimize communication overhead, +only fragments of XML, called \term{stanzas}, are sent between hosts. A stanza +is always well-formed as a whole; it consist of a root element, which also +includes routing attributes (\code{to} and \code{from}), and its optional child +elements. + +On top of that, living connections between hosts are represented by \term{XML +streams}. The client initiates a connection by sending an XML declaration +followed by an opening \code{} tag. The server then responds also with +an opening \code{} tag. The client then performs SASL authentication and +binds its stream to a resource for proper addressing. If this process succeeded, +both client and server can send an unlimited number of stanzas, until the +connection is closed by one side by sending an closing \code{} tag. The +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} + \subsubsection{Multi-User Chats} \cite{xep-0045} \subsubsection{Publish/Subscribe and the Roster} -is this really needed? - \cite{xep-0060} \subsubsection{Presence} \cite{rfc6120} -\begin{itemize} - \item architecture: client-server, use of DNS-SD - \item addressing: JIDs, resources - \item XML-based communication primitives, stanzas and streams - \item presence - \item publish/subscribe \cite{xep-0060}, roster - \item multi-user chats \cite{xep-0045} -\end{itemize} - - \subsubsection{XMPP Serverless Messaging} \todo