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
]{Example: 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{6pt
}{0.7em
}\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.4]{
159 \verb+juliet._presence.+\\
\verb+_tcp.local+
};
160 \draw[->
] (romeo) -- (thecloud) node
[pkt,pos=
0.4]{
161 \verb+romeo._presence.+\\
\verb+_tcp.local+
};
162 \draw[->
] (mercutio) -- (thecloud) node
[pkt,pos=
0.4]{
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+
};
180 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
181 \againframe<
3>
{subgoals
}
183 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
184 \begin{frame
}{XMPP (RFC
6122)
}
186 \column{.55\textwidth}
188 \begin{block
}{Extensible Messaging and Presence Protocol
}
191 \item Federated architecture
193 \item modeled after E-Mail
195 \item publish-subscribe mechanism
196 \item XMPP Extension Protocols (XEPs), e.\,g.
198 \item Multi-User Chats
% (XEP-0045)
199 \item Serverless Messaging
%(XEP-0174)
200 \item recently, also XEPs for the IoT
%(XEP-0323 through -0326)
206 \begin{block
}{Serverless XMPP (XEP-
0174)
}
208 \item Clients communicate directly, no server needed
209 \item service discovery via mDNS/DNS-SD
214 \column{.45\textwidth}
215 \tikzset{node distance=
0pt, >=stealth, thick, x=
3.5em, y=
2.8em
}
216 \tikzstyle{iconlabel
}=
[text width=
2.5cm, align=center,
217 font=
\fontsize{7.5pt
}{1em
}\selectfont]
218 \tikzstyle{label
}=
[font=
\fontsize{7pt
}{1em
}\selectfont]
221 \begin{tikzpicture
}[remember picture
]
222 \input{fig-xmpparch.tex
}
225 \tikz[remember picture,overlay
]
226 \draw<
2>
[<->,dotted
] (juliet) -- node
[anchor=south,label
]{serverless
} (romeo);
231 \begin{frame
}{XMPP (RFC
6122)
}
232 \begin{block
}{XEPs for the Internet of Things
}
234 \item XEP-
0323 Sensor Data
236 \item format for sensor data, query modes
238 \item XEP-
0324 Provisioning
240 \item defining access rights and user privileges
242 \item XEP-
0325 Control
244 \item get/set control prameters on a (group of) sensor node(s)
246 \item XEP-
0326 Concentrators
248 \item implement proxies for a subnet of the WSN
254 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
255 \againframe<
4>
{subgoals
}
257 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
258 \section{Chatty Things
}
259 \begin{frame
}{Chatty Things
}
261 \item use serverless XMPP + mDNS + DNS-SD for communication
262 \item interaction using a standard XMPP client
263 \item prevent information overflow
265 \item ``Traffic lights'': status icon in roster represents threshold value
266 \item \emph{Temporary Subscription for Presence (TSP)
}
268 %\item working prototype for Contiki on MSP430
270 \begin{block
}{Prototype
}
272 \item \emph{uBonjour
} for mDNS + DNS-SD
273 \item \emph{uXMPP
} for XMPP
274 \item 12~kB of ROM,
0.6 kB of RAM with Contiki on MSP-
430
279 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
280 \begin{frame
}{Temporary Subscription for Presence
}
281 \begin{block
}{Problem
}
283 \item node must manually subscribe to get information
284 \item users can move quickly out of the network
285 \item subscriptions become outdated
286 \item renewing/canceling subscriptions needs bandwidth
287 \item data publishers also get updates
292 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
293 \begin{frame
}{Temporary Subscription for Presence
}
294 \begin{block
}{Solution: Multi-User Chats
}
296 \item create one chat room per topic
297 \item users subscribe to information by entering the chat room
298 \item server only sends information to nodes who want it
300 \item Chatty Things send a flag that they're uninterested
304 \begin{block
}{Drawbacks
}
306 \item only works with central XMPP server
308 \item XEP-
0045 is not (yet) specified for serverless XMPP
310 \item XMPP server needs to handle TSP
315 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
316 \begin{frame
}{Bootstrapping
}
317 \begin{block
}{At Boot
}
319 \item activate uBonjour
320 \item try to discover a central XMPP server
322 \item DNS-SD:
\code{\_xmpp-client.
\_tcp.local
}
324 \item if an XMPP server is discovered:
\emph{Infrastructure mode
}
326 \item connect with ANONYMOUS login (XEP-
0175)
327 \item join topic-based chats
328 \item deactivate uBonjour
330 \item if no server is found:
\emph{Ad hoc mode
}
332 \item activate serverless messaging
337 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
338 \begin{frame
}{Bootstrapping
}
339 \begin{block
}{During Runtime
}
341 \item if server is lost, change to Ad hoc mode
342 \item if new server is found in Ad hod mode, try changing to Infrastructure
345 \item if that fails, stay in Ad hoc mode
351 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
352 \againframe<
5>
{subgoals
}
354 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
355 \section{Related Approaches
}
356 \begin{frame
}{Related Approaches
}
359 \begin{block
}{Chatty Things
}
362 \begin{block
}{Constrained Application Protocol (CoAP)
}
364 \item binary mapping to HTTP
365 \item UDP with confirmation and congestion control
369 \begin{block
}{MQ Telemetry Transport (MQTT)
}
371 \item binary, only
2-byte header
372 \item focused on M2M communication
376 \begin{block
}{Web Service for Devices (WS4D)
}
378 \item SOAP (XML-based) over HTTP
384 \begin{tabular
}{|>
{\onslide<
1->
}l||>
{\onslide<
1->
}l|>
{\onslide<
2->
}l|
385 >
{\onslide<
3->
}l|>
{\onslide<
4->
}l<
{\onslide}|
}
387 Feature & Chatty Things & CoAP & MQTT & WS4D \\
389 application gateways & - & yes & yes & - \\
\hline
390 usable with standard clients & yes & - & - & (yes) \\
\hline
391 discovery support & yes & yes & - & yes\\
\hline
392 IPv6/
6LoWPAN ready & yes & yes & ? & partial \\
\hline
393 asynchronous messages & yes & yes & ? & ? \\
\hline
394 protocol overhead & moderate & low & low & high \\
\hline
399 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
401 \begin{frame
}{Conclusion
}
402 \begin{block
}{Advantages of Chatty Things
}
404 \item no need for central infrastructure
405 \item self-configuration and auto-discovery
406 \item interaction over standard chat clients
407 \item protocol flexibility for enhancements
410 \begin{block
}{Disadvantages of Chatty Things
}
412 \item XMPP introduces some complexity
413 \item topic filtering only possible with central server
418 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
421 \centering\LARGE{Questions?
}
425 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
435 \newcommand{\advanceby}[1]{%
436 \addtolength{\ypos}{#1}%
437 \addtolength{\yypos}{#1}%
438 \global\ypos=
\ypos% // see https://tex.stackexchange.com/questions/119730
439 \global\yypos=
\yypos%
443 below=-
.5\baselineskip,
446 dash pattern=on
2pt off
2pt,
448 \tikzstyle{clipkt
}=
[pkt,
449 below left=-
.5\baselineskip and
0cm,
452 \tikzstyle{devpkt
}=
[pkt,
453 below right=-
.5\baselineskip and
0cm,
457 \begin{frame
}[fragile,plain,t
]{Example: Sensor Data
}
459 every node/.style=
{fill=white, font=
\small},
460 every picture/.style=ultra thin,
464 \setlength{\ypos}{0cm
}
465 \setlength{\yypos}{.5cm
}
467 \draw (
\cli,
\top) node
[draw
]{Client
} -- (
\cli,
\nearlybot);
468 \draw[dashed
] (
\cli,
\nearlybot) -- (
\cli,
\bot);
469 \draw (
\dev,
\top) node
[draw
]{Device
} -- (
\dev,
\nearlybot);
470 \draw[dashed
] (
\dev,
\nearlybot) -- (
\dev,
\bot);
473 \draw[->
] (
\cli,-
\ypos) -- (
\dev,-
\yypos) node
[clipkt
]{\verb+<stream>+
};
475 \draw[->
] (
\dev,-
\ypos) -- (
\cli,-
\yypos) node
[devpkt
]{\verb+<stream>+
};
478 \draw[->
] (
\cli,-
\ypos) -- (
\dev,-
\yypos) node
[clipkt,align=left
]{
479 \verb+<iq type='get' id='
1'+\\
480 \verb+ to='dev@device.local/res'+\\
481 \verb+ from='client@client.local'>+\\
482 \verb+ <req xmlns='urn:xmpp:sn' seqnr='
1'+\\
483 \verb+ momentary='true'>+\\
484 \verb+ <node nodeId='Device04'/>+\\
485 \verb+ <field name='+
{\color{red
}\code{Energy
}}\verb+'/>+\\
486 \verb+ <field name='+
{\color{blue
}\code{Power
}}\verb+'/>+\\
489 \advanceby{9\baselineskip}
493 \draw[->
] (
\dev,-
\ypos) -- (
\cli,-
\yypos) node
[devpkt,align=left
]{
494 \verb+<iq type='result' id='
1'+\\
495 \verb+ from='dev@device.local'+\\
496 \verb+ to='client@client.local/res'>+\\
497 \verb+ <accepted xmlns='urn:xmpp:sn' seqnr='
1'/>+\\
499 \advanceby{4\baselineskip}
504 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
505 \begin{frame
}[fragile,plain,t
]{Example: Sensor Data (cont.)
}
507 every node/.style=
{fill=white, font=
\small},
508 every picture/.style=ultra thin,
512 \setlength{\ypos}{0cm
}
513 \setlength{\yypos}{.5cm
}
515 \draw[dashed
] (
\cli,
\top) node
[draw
]{Client
} -- (
\cli,
\nearlytop);
516 \draw (
\cli,
\nearlytop) -- (
\cli,
\bot);
517 \draw[dashed
] (
\dev,
\top) node
[draw
]{Device
} -- (
\dev,
\nearlytop);
518 \draw (
\dev,
\nearlytop) -- (
\dev,
\bot);
522 \draw[->
] (
\dev,-
\ypos) -- (
\cli,-
\yypos) node
[devpkt,align=left
]{
523 \verb+<message from='dev@device.local'+\\
524 \verb+ to='client@client.local/res'>+\\
525 \verb+ <fields xmlns='urn:xmpp:sn' seqnr='
1' done='true'>+\\
526 \verb+ <node nodeId='Device04'>+\\
527 \verb+ <timestamp value='
2013-
03-
07T22:
03:
15'>+\\
528 \verb+ <numeric name='+
{\color{red
}\code{Energy
}}\verb+' momentary='true'+\\
529 \verb+ value='+
{\color{red
}\code{167.5}}\verb+' unit='+
{\color{red
}\code{kWh
}}\verb+'/>+\\
530 \verb+ <numeric name='+
{\color{blue
}\code{Power
}}\verb+' momentary='true'+\\
531 \verb+ value='+
{\color{blue
}\code{239.4}}\verb+' unit='+
{\color{blue
}\code{W
}}\verb+'/>+\\
532 \verb+ </timestamp>+\\
536 \advanceby{12\baselineskip}
540 \draw[->
] (
\cli,-
\ypos) -- (
\dev,-
\yypos) node
[clipkt
]{\verb+</stream>+
};
542 \draw[->
] (
\dev,-
\ypos) -- (
\cli,-
\yypos) node
[devpkt
]{\verb+</stream>+
};