sync: chatty things: service provisioning, bootstrap
[skm-ma-ws1314.git] / sec-chatty-things.tex
1 \section{System Architecture of ``Chatty Things''}
3 After the underlying techniques have been explained, we can have a look at the
4 system architecture which Klauck and
5 Kirsche~\cite{Klauck:2012:BCC:2352852.2352881} use to build Chatty Things.
8 \todo
9 \pages{3}
10 \subsection{Service Provisioning Sublayer}
12 Considering the application in deeply embedded systems and the special needs of
13 the Internet of Things on the one hand, the protocol stack needs to fulfil
14 certain technical requirements.
16 First, memory, computing resources and bandwith on embedded systems are limited,
17 which demands for a lightweight protocol stack without too much overhead and
18 predictable memory consumption, while also retaining enough flexibility for
19 future development. The authors therefore provide only the most essential
20 functions of XMPP (presence and message exchange, multi-user chats) to achieve
21 basic communication, grouping of devices, and information filtering to prevent
22 information overflow.
24 Their solution builds on the \term{Contiki} operating system on an MSP430 board,
25 and uses the \term{uXMPP} project, which already implements core XMPP features
26 and serves as a starting point for implementing further XEPs. However, as the
27 uXMPP project was still in early development, they first needed to enhance its
28 functionality to comply with the limited resources. In particular, they
29 optimized the message flow and enabled uXMPP to fully use the available payload
30 instead of sending one TCP packet per message and reduced the code footprint
31 through compiler flags and refactoring.
33 Furthermore, Klauck and Kirsche implemented new features for uXMPP, which were
34 realized as separate modules to allow enabling and disabling them at runtime,
35 thus further reducing the memory footprint of a running system:
37 \todo[minimize space between list item]
38 \begin{itemize}
39 \item support for IPv6
40 \item support for Multi-User Chats (XEP-0045), which are used for information
41 filtering
42 \item support for SASL ANONYMOUS login for XMPP servers \ref{xep-0175}
43 \item a new publish-subscribe mechanism called Temporary Subscription for
44 Presence (see \ref{sec:tsp})
45 \item XMPP Serverless Messaging (XEP-0174), using \term{uBonjour} as
46 underlying mDNS/DNS-SD implementation for Contiki.
47 \end{itemize}
49 The resulting implementation (uXMPP and uBonjour) gets by with 12{.}2\ kBytes of
50 ROM and 0{.}63\ kBytes of RAM, which was about the size of the original,
51 unoptimized uXMPP implementation while also implementing new features.
53 \todo[figure of example network structure with and without central server]
55 In order to react to different network infrastructures, their implementation
56 allows both communication with a central XMPP server as well as peer-to-peer
57 communication over XMPP Serverless Messaging. When a central XMPP server is
58 detected over uBonjour, it is used instead with the ANONYMOUS login method, and the
59 XEP-0174 module is disabled. The ANONYMOUS login method is chosen since TLS
60 encryption is not yet implemented, and it assigns random JID to the client,
61 which do not need to exist on the server. However, a server must exist and must
62 be configured in order to use this method.
64 With a server, information filtering is achieved by creating topic-based
65 Multi-User Chats where multiple devices can be grouped. A user can then simply
66 join the chat with a standard XMPP client on her machine and interact with all
67 devices of a topic, or she can also interact with them directly.
69 In scenarios without an XMPP server, the XEP-0174 module is activated and
70 devices talk directly with the user or with other devices. This method has the
71 drawback that Multi-User Chats cannot be used for topic filtering, since no
72 method is specified to do XEP-0045 and XEP-0174 at the same time. \todo[temporary subscription presence here?]
73 In this case,
74 a user must have an XEP-0174-compliant chat client, but it also gives her the
75 opportunity to interact with things spontaneously on an ad-hoc basis (e.~g. when
76 entering a room) without need for any additional gateway on the application
77 level.
79 %low bandwith in IEEE~802.15.4 (less than 250 kib/s at a maximum of 122 byte per
80 %packet\footnote{according to the maximum MAC payload size in the IEEE~802.15.4-2011
81 %specification}
83 \subsection{Bootstrapping}
85 In a distributed context like the Internet of Things, devices need to be ready
86 to use out of the box. Users often do not want to set up configurations for each
87 device they use, and when using several of those devices, it is often not
88 reasonable having to configure every single one.
90 With the given approach, bootstrapping new Chatty Things is easy and no
91 configuration is neccessary: on the network layer, IP addresses can simply be
92 obtained using IPv4 Link-Local Addressing or IPv6 Stateless Address
93 Autoconfiguration. On the transport layer, all needed ports can be obtained over
94 DNS-Based Service Discovery. Finally, on the application layer, host names can
95 be resolved over Multicast DNS; and for the actual communication between devices
96 it is possible to use auto-generated JIDs with the ANONYMOUS login method on an
97 existing XMPP server, or if no server is found, use peer-to-peer communication
98 over XMPP Serverless Messaging.
100 Bootstrapping a Chatty Thing therefore incorporates three steps:
102 \begin{enumerate}
103 \item Activate uBonjour and try to discover an XMPP server
104 \item If a server is found, connect to it using ANONYMOUS login, join
105 topic-based Multi-User Chats, deactivate the uBonjour client
106 \term(Infrastructure mode).
107 \item If no server is found, activate the XEP-0174 client \term{Ad-hoc mode}.
108 \end{enumerate}
110 During runtime, a device can then react to changes in network infrastructure:
112 \begin{itemize}
113 \item In Infrastructure mode: when connection to the server is lost, enable
114 the uBonjour client, try to find a server, and when none is found, enable
115 Serverless Messaging.
116 \item In Ad-hoc mode: if uBonjour detects a new XMPP server joining the
117 network, try to connect to it. If this succeeds, disable Serverless
118 Messaging and uBonjour and join topic-based Multi-User Chats.
119 \end{itemize}
121 \todo[short conclusion?]
123 \subsection{Temporary Subscription for Presence}\label{sec:tsp}
125 To further reduce the message overhead
127 % vim: set ft=tex et ts=2 sw=2 :
This page took 0.084784 seconds and 5 git commands to generate.