2 \usepackage[utf8
]{inputenc}
3 \usepackage[english
]{babel
}
5 \usepackage{inconsolata
}
9 \usetikzlibrary{arrows
}
10 \usetikzlibrary{arrows
}
11 \usetikzlibrary{positioning
}
12 \usetikzlibrary{shapes.symbols
}
13 %\usepackage[usenames,dvipsnames]{color}
15 %\presetkeys{todonotes}{inline}{}
16 \newcommand{\code}[1]{\texttt{#1}}
17 \definecolor{green
}{RGB
}{137,
164,
0} % from tubslatex
20 \subtitle{Making the Internet of Things Readily Usable for the Masses with XMPP
}
21 \author{Roland Hieber
}
22 \institute[IBR, TU-BS
]{Institute of Operating Systems and Computer Networks
}
23 \date[SKM-
13/
14]{Seminar Communications and Multimedia, WS
2013/
14}
31 \begin{frame
}{Contents
}
35 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
37 \begin{frame
}{Motivation
}
38 \begin{block
}{The IoT Vision
}
40 \item plentitude of smart objects
41 \item interoperability between devices
42 \item easy accessibility for users
47 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
48 \begin{frame
}<
1>
[label=subgoals
]{Motivation: Subgoals
}
49 \begin{block
}{But how do we
\ldots}
51 \item configure our devices?
53 \invisible<
1-
1>
{\item[\color{green
}\checkmark]\color{green
}
54 Link-Local Addressing, Stateless Address Autoconfiguration
}
56 \item find other nodes to talk to?
58 \invisible<
1-
2>
{\item[\color{green
}\checkmark]\color{green
}
61 \item talk to other nodes or users?
63 \invisible<
1-
3>
{\item[\color{green
}\checkmark]\color{green
} XMPP
66 \item filter relevant information?
68 \invisible<
1-
4>
{\item[\color{green
}\checkmark]\color{green
} ``Traffic
69 Lights'', Temporary Subscription for Presence
}
75 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
76 \section{Technologies for Distributed Networking
}
77 \begin{frame
}{Address Allocation
}
78 IPv4 Link-Local Addessing (``APIPA'', ``Zeroconf'', RFC
3927)
80 \item subnet
\code{169.254.0.0/
16}
82 IPv6 Stateless Address Autoconfiguration (RFC
4862)
84 \item subnet
\code{fe80::/
64} (link-local)
85 \item subnet
\code{fc00::/
11} (unique-local, if configured)
86 \item or global address (if configured)
89 \begin{block
}{Algorithm
}
91 \item choose (random) IP address in subnet
92 \item ask if anyone uses that address
93 \item if not, we're fine
99 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
100 \againframe<
2>
{subgoals
}
102 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
103 \begin{frame
}{Multicast DNS (RFC
6762)
}
105 \item distributed DNS database
106 \item uses multicast address
\code{224.0.0.251} (IPv4) and
\code{ff02::fb
}
107 (IPv6), UDP port
5353
108 \item standard DNS packet format
109 \item hosts announce their own resources
110 \item hosts respond to queries if queried resource is known
114 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
115 \begin{frame
}{DNS-Based Service Discovery (RFC
6763)
}
118 \item Service Instance Enumeration
120 \item query PTR records of form
\code{\_service.
\_proto.domain
}
121 \item results: instance names of form
\code{name.
\_service.
\_proto.domain
}
123 \item Service Instance Resolution
125 \item query instance names as SRV records
126 \item result gives host name, port, priority, weight
131 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
132 \begin{frame
}[fragile
]{mDNS + DNS-SD
}
133 \tikzset{font=
\fontsize{7.5pt
}{1em
}\selectfont, >=latex, thick, y=
3.5em
}
134 %\tikzstyle{iconlabel}=[text width=2cm, align=center,
135 %font=\fontsize{7.5pt}{1em}\selectfont]
136 \tikzstyle{label
}=
[font=
\fontsize{7pt
}{1em
}\selectfont]
137 \tikzstyle{pkt
}=
[font=
\fontsize{7pt
}{1em
}\selectfont,
138 draw,fill=white,dash pattern=on
2pt off
2pt, align=center,
140 \def\xhalf{.45\textwidth}
143 \item Service Instance Enumeration
145 \node[cloud,draw,fill=gray!
20,aspect=
2] (thecloud) at (
0,
0)
{multicast
};
147 node/
{(-
\xhalf,
0)
}/
{},
148 juliet/
{(
\xhalf,
0)
}/juliet,
149 romeo/
{(
\xhalf,-
1)
}/romeo,
150 mercutio/
{(
\xhalf,
1)
}/mercutio
%
152 \foreach \name/
\pos/
\text in
\nodelist {
153 \node (
\name) at
\pos { \includegraphics[width=
3em
]{icon-computer.pdf
} };
154 \node[below=
\nodeskip of
\name.north,label
] (
\name text)
{ \text };
156 \draw[->
] (node) -- (thecloud) node
[pkt,pos=
0.5]{
157 \verb+_presence._tcp.local+\
\PTR?
};
158 \draw[->
] (juliet) -- (thecloud) node
[pkt,pos=
0.35]{
159 \verb+juliet._presence.+\\
\verb+_tcp.local+
};
160 \draw[->
] (romeo) -- (thecloud) node
[pkt,pos=
0.35]{
161 \verb+romeo._presence.+\\
\verb+_tcp.local+
};
162 \draw[->
] (mercutio) -- (thecloud) node
[pkt,pos=
0.35]{
163 \verb+mercutio._presence.+\\
\verb+_tcp.local+
};
166 \item Service Instance Resolution
168 \node[cloud,draw,fill=gray!
20,aspect=
2] (thecloud) at (
0,
0)
{multicast
};
169 \node (node) at (-
\xhalf,
0)
{ \includegraphics[width=
3em
]{icon-computer.pdf
} };
170 \node (juliet) at (
\xhalf,
0)
{ \includegraphics[width=
3em
]{icon-computer.pdf
} };
171 \node[below=
\nodeskip of juliet.north,label
] (juliet text)
{ juliet
};
172 \draw[->
] (node) -- (thecloud) node
[pkt,pos=
0.5]{
173 \verb+juliet._presence._tcp.local+\
\SRV?
};
174 \draw[->
] (juliet) -- (thecloud) node
[pkt,pos=
0.5]{
175 \verb+juliet.local, port
5222,+\\
\verb+prio
0, weight
0+
};
178 %\node[draw] (resptr) at (0,-4) {\code{juliet.\_presence.\_tcp.local} SRV?};
179 %\node[draw] (resres) at (16em,-4) {\code{juliet.local, port 5222, prio 0, weight 0}};
181 %\draw[->] (enumptr) -- (enumres);
182 %\draw[->] (resptr) -- (resres);
187 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
188 \againframe<
3>
{subgoals
}
190 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
191 \begin{frame
}{XMPP (RFC
6122)
}
193 \column{.55\textwidth}
195 \begin{block
}{Extensible Messaging and Presence Protocol
}
198 \item Federated architecture
200 \item modeled after E-Mail
202 \item publish-subscribe mechanism
203 \item XMPP Extension Protocols (XEPs), e.\,g.
205 \item Multi-User Chats
% (XEP-0045)
206 \item Serverless Messaging
%(XEP-0174)
207 \item recently, also XEPs for the IoT
%(XEP-0323 through -0326)
213 \begin{block
}{Serverless XMPP (XEP-
0174)
}
215 \item Clients communicate directly, no server needed
216 \item service discovery via mDNS/DNS-SD
221 \column{.45\textwidth}
222 \tikzset{node distance=
0pt, >=stealth, thick, x=
3.5em, y=
2.8em
}
223 \tikzstyle{iconlabel
}=
[text width=
2.5cm, align=center,
224 font=
\fontsize{7.5pt
}{1em
}\selectfont]
225 \tikzstyle{label
}=
[font=
\fontsize{7pt
}{1em
}\selectfont]
228 \begin{tikzpicture
}[remember picture
]
229 \input{fig-xmpparch.tex
}
232 \tikz[remember picture,overlay
]
233 \draw<
2>
[<->,dotted
] (juliet) -- node
[anchor=south,label
]{serverless
} (romeo);
238 \begin{frame
}{XMPP (RFC
6122)
}
239 \begin{block
}{XEPs for the Internet of Things
}
241 \item XEP-
0323 Sensor Data
243 \item format for sensor data, query modes
245 \item XEP-
0324 Provisioning
247 \item defining access rights and user privileges
249 \item XEP-
0325 Control
251 \item get/set control prameters on a (group of) sensor node(s)
253 \item XEP-
0326 Concentrators
255 \item implement proxies for a subnet of the WSN
261 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
262 \againframe<
4>
{subgoals
}
264 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
265 \section{Chatty Things
}
266 \begin{frame
}{Chatty Things
}
268 \item use serverless XMPP + mDNS + DNS-SD for communication
269 \item interaction using a standard XMPP client
270 \item prevent information overflow
272 \item ``Traffic lights'': status icon in roster represents threshold value
273 \item \emph{Temporary Subscription for Presence (TSP)
}
275 %\item working prototype for Contiki on MSP430
277 \begin{block
}{Prototype
}
279 \item \emph{uBonjour
} for mDNS + DNS-SD
280 \item \emph{uXMPP
} for XMPP
281 \item 12~kB of ROM,
0.6 kB of RAM with Contiki on MSP-
430
286 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
287 \begin{frame
}{Temporary Subscription for Presence
}
288 \begin{block
}{Problem
}
290 \item node must manually subscribe to get information
291 \item users can move quickly out of the network
292 \item subscriptions become outdated
293 \item renewing/canceling subscriptions needs bandwidth
294 \item data publishers also get updates
299 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
300 \begin{frame
}{Temporary Subscription for Presence
}
301 \begin{block
}{Solution: Multi-User Chats
}
303 \item create one chat room per topic
304 \item users subscribe to information by entering the chat room
305 \item server only sends information to nodes who want it
307 \item Chatty Things send a flag that they're uninterested
311 \begin{block
}{Drawbacks
}
313 \item only works with central XMPP server
315 \item XEP-
0045 is not (yet) specified for serverless XMPP
317 \item XMPP server needs to handle TSP
322 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
323 \begin{frame
}{Bootstrapping
}
324 \begin{block
}{At Boot
}
326 \item activate uBonjour
327 \item try to discover a central XMPP server
329 \item DNS-SD:
\code{\_xmpp-client.
\_tcp.local
}
331 \item if an XMPP server is discovered:
\emph{Infrastructure mode
}
333 \item connect with ANONYMOUS login (XEP-
0175)
334 \item join topic-based chats
335 \item deactivate uBonjour
337 \item if no server is found:
\emph{Ad hoc mode
}
339 \item activate serverless messaging
344 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
345 \begin{frame
}{Bootstrapping
}
346 \begin{block
}{During Runtime
}
348 \item if server is lost, change to Ad hoc mode
349 \item if new server is found in Ad hod mode, try changing to Infrastructure
352 \item if that fails, stay in Ad hoc mode
358 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
359 \againframe<
5>
{subgoals
}
361 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
362 \section{Related Approaches
}
363 \begin{frame
}{Related Approaches
}
366 \begin{block
}{Chatty Things
}
369 \begin{block
}{Constrained Application Protocol (CoAP)
}
371 \item binary mapping to HTTP
372 \item UDP with confirmation and congestion control
376 \begin{block
}{MQ Telemetry Transport (MQTT)
}
378 \item binary, only
2-byte header
379 \item focused on M2M communication
383 \begin{block
}{Web Service for Devices (WS4D)
}
385 \item SOAP (XML-based) over HTTP
391 \begin{tabular
}{|>
{\onslide<
1->
}l||>
{\onslide<
1->
}l|>
{\onslide<
2->
}l|
392 >
{\onslide<
3->
}l|>
{\onslide<
4->
}l<
{\onslide}|
}
394 Feature & Chatty Things & CoAP & MQTT & WS4D \\
396 application gateways & - & yes & yes & - \\
\hline
397 usable with standard clients & yes & - & - & (yes) \\
\hline
398 discovery support & yes & yes & - & yes\\
\hline
399 IPv6/
6LoWPAN ready & yes & yes & ? & partial \\
\hline
400 asynchronous messages & yes & yes & ? & ? \\
\hline
401 protocol overhead & moderate & low & low & high \\
\hline
406 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
408 \begin{frame
}{Conclusion
}
409 \begin{block
}{Advantages of Chatty Things
}
411 \item no need for central infrastructure
412 \item self-configuration and auto-discovery
413 \item interaction over standard chat clients
414 \item protocol flexibility for enhancements
417 \begin{block
}{Disadvantages of Chatty Things
}
419 \item XMPP introduces some complexity
420 \item topic filtering only possible with central server
425 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
428 \centering\LARGE{Questions?
}
432 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
442 \newcommand{\advanceby}[1]{%
443 \addtolength{\ypos}{#1}%
444 \addtolength{\yypos}{#1}%
445 \global\ypos=
\ypos% // see https://tex.stackexchange.com/questions/119730
446 \global\yypos=
\yypos%
450 below=-
.5\baselineskip,
453 dash pattern=on
2pt off
2pt,
455 \tikzstyle{clipkt
}=
[pkt,
456 below left=-
.5\baselineskip and
0cm,
459 \tikzstyle{devpkt
}=
[pkt,
460 below right=-
.5\baselineskip and
0cm,
464 \begin{frame
}[fragile,plain,t
]{Example: Sensor Data
}
466 every node/.style=
{fill=white, font=
\small},
467 every picture/.style=ultra thin,
471 \setlength{\ypos}{0cm
}
472 \setlength{\yypos}{.5cm
}
474 \draw (
\cli,
\top) node
[draw
]{Client
} -- (
\cli,
\nearlybot);
475 \draw[dashed
] (
\cli,
\nearlybot) -- (
\cli,
\bot);
476 \draw (
\dev,
\top) node
[draw
]{Device
} -- (
\dev,
\nearlybot);
477 \draw[dashed
] (
\dev,
\nearlybot) -- (
\dev,
\bot);
480 \draw[->
] (
\cli,-
\ypos) -- (
\dev,-
\yypos) node
[clipkt
]{\verb+<stream>+
};
482 \draw[->
] (
\dev,-
\ypos) -- (
\cli,-
\yypos) node
[devpkt
]{\verb+<stream>+
};
485 \draw[->
] (
\cli,-
\ypos) -- (
\dev,-
\yypos) node
[clipkt,align=left
]{
486 \verb+<iq type='get' id='
1'+\\
487 \verb+ to='dev@device.local/res'+\\
488 \verb+ from='client@client.local'>+\\
489 \verb+ <req xmlns='urn:xmpp:sn' seqnr='
1'+\\
490 \verb+ momentary='true'>+\\
491 \verb+ <node nodeId='Device04'/>+\\
492 \verb+ <field name='+
{\color{red
}\code{Energy
}}\verb+'/>+\\
493 \verb+ <field name='+
{\color{blue
}\code{Power
}}\verb+'/>+\\
496 \advanceby{9\baselineskip}
500 \draw[->
] (
\dev,-
\ypos) -- (
\cli,-
\yypos) node
[devpkt,align=left
]{
501 \verb+<iq type='result' id='
1'+\\
502 \verb+ from='dev@device.local'+\\
503 \verb+ to='client@client.local/res'>+\\
504 \verb+ <accepted xmlns='urn:xmpp:sn' seqnr='
1'/>+\\
506 \advanceby{4\baselineskip}
511 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
512 \begin{frame
}[fragile,plain,t
]{Example: Sensor Data (cont.)
}
514 every node/.style=
{fill=white, font=
\small},
515 every picture/.style=ultra thin,
519 \setlength{\ypos}{0cm
}
520 \setlength{\yypos}{.5cm
}
522 \draw[dashed
] (
\cli,
\top) node
[draw
]{Client
} -- (
\cli,
\nearlytop);
523 \draw (
\cli,
\nearlytop) -- (
\cli,
\bot);
524 \draw[dashed
] (
\dev,
\top) node
[draw
]{Device
} -- (
\dev,
\nearlytop);
525 \draw (
\dev,
\nearlytop) -- (
\dev,
\bot);
529 \draw[->
] (
\dev,-
\ypos) -- (
\cli,-
\yypos) node
[devpkt,align=left
]{
530 \verb+<message from='dev@device.local'+\\
531 \verb+ to='client@client.local/res'>+\\
532 \verb+ <fields xmlns='urn:xmpp:sn' seqnr='
1' done='true'>+\\
533 \verb+ <node nodeId='Device04'>+\\
534 \verb+ <timestamp value='
2013-
03-
07T22:
03:
15'>+\\
535 \verb+ <numeric name='+
{\color{red
}\code{Energy
}}\verb+' momentary='true'+\\
536 \verb+ value='+
{\color{red
}\code{167.5}}\verb+' unit='+
{\color{red
}\code{kWh
}}\verb+'/>+\\
537 \verb+ <numeric name='+
{\color{blue
}\code{Power
}}\verb+' momentary='true'+\\
538 \verb+ value='+
{\color{blue
}\code{239.4}}\verb+' unit='+
{\color{blue
}\code{W
}}\verb+'/>+\\
539 \verb+ </timestamp>+\\
543 \advanceby{12\baselineskip}
547 \draw[->
] (
\cli,-
\ypos) -- (
\dev,-
\yypos) node
[clipkt
]{\verb+</stream>+
};
549 \draw[->
] (
\dev,-
\ypos) -- (
\cli,-
\yypos) node
[devpkt
]{\verb+</stream>+
};