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, TU
24 \date[SKM-
13/
14]{Seminar Communications and Multimedia, WS
2013/
14}
32 \begin{frame
}{Contents
}
36 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 \begin{frame
}{Motivation
}
39 \begin{block
}{The IoT Vision
}
41 \item plentitude of smart objects
42 \item interoperability between devices
43 \item easy accessibility for users
48 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49 \begin{frame
}<
1>
[label=subgoals
]{Motivation: Subgoals
}
50 \begin{block
}{But how do we
\ldots}
52 \item configure our devices?
54 \invisible<
1-
1>
{\item[\color{green
}\checkmark]\color{green
}
55 Link-Local Addressing, Stateless Address Autoconfiguration
}
57 \item find other nodes to talk to?
59 \invisible<
1-
2>
{\item[\color{green
}\checkmark]\color{green
}
62 \item talk to other nodes or users?
64 \invisible<
1-
3>
{\item[\color{green
}\checkmark]\color{green
} XMPP
67 \item filter relevant information?
69 \invisible<
1-
4>
{\item[\color{green
}\checkmark]\color{green
} ``Traffic
70 Lights'', Temporary Subscription for Presence
}
76 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
77 \section{Technologies for Distributed Networking
}
78 \begin{frame
}{Address Allocation
}
79 IPv4 Link-Local Addessing (``APIPA'', ``Zeroconf'', RFC
3927)
81 \item subnet
\code{169.254.0.0/
16}
83 IPv6 Stateless Address Autoconfiguration (RFC
4862)
85 \item subnet
\code{fe80::/
64} (link-local)
86 \item subnet
\code{fc00::/
11} (unique-local, if configured)
87 \item or global address (if configured)
90 \begin{block
}{Algorithm
}
92 \item choose (random) IP address in subnet
93 \item ask if anyone uses that address
94 \item if not, we're fine
100 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
101 \againframe<
2>
{subgoals
}
103 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
104 \begin{frame
}{Multicast DNS (RFC
6762)
}
106 \item distributed DNS database
107 \item uses multicast address
\code{224.0.0.251} (IPv4) and
\code{ff02::fb
}
108 (IPv6), UDP port
5353
109 \item standard DNS packet format
110 \item hosts announce their own resources
111 \item hosts respond to queries if queried resource is known
115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
116 \begin{frame
}{DNS-Based Service Discovery (RFC
6763)
}
119 \item Service Instance Enumeration
121 \item query PTR records of form
\code{\_service.
\_proto.domain
}
122 \item results: instance names of form
\code{name.
\_service.
\_proto.domain
}
124 \item Service Instance Resolution
126 \item query instance names as SRV records
127 \item result gives host name, port, priority, weight
132 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
133 \begin{frame
}[fragile
]{Example: mDNS + DNS-SD
}
134 \tikzset{font=
\fontsize{7.5pt
}{1em
}\selectfont, >=latex, thick, y=
3.5em
}
135 %\tikzstyle{iconlabel}=[text width=2cm, align=center,
136 %font=\fontsize{7.5pt}{1em}\selectfont]
137 \tikzstyle{label
}=
[font=
\fontsize{7pt
}{1em
}\selectfont]
138 \tikzstyle{pkt
}=
[font=
\fontsize{6pt
}{0.7em
}\selectfont,
139 draw,fill=white,dash pattern=on
2pt off
2pt, align=center,
141 \def\xhalf{.45\textwidth}
144 \item Service Instance Enumeration
146 \node[cloud,draw,fill=gray!
20,aspect=
2] (thecloud) at (
0,
0)
{multicast
};
148 node/
{(-
\xhalf,
0)
}/
{},
149 juliet/
{(
\xhalf,
0)
}/juliet,
150 romeo/
{(
\xhalf,-
1)
}/romeo,
151 mercutio/
{(
\xhalf,
1)
}/mercutio
%
153 \foreach \name/
\pos/
\text in
\nodelist {
154 \node (
\name) at
\pos { \includegraphics[width=
3em
]{icon-computer.pdf
} };
155 \node[below=
\nodeskip of
\name.north,label
] (
\name text)
{ \text };
157 \draw[->
] (node) -- (thecloud) node
[pkt,pos=
0.5]{
158 \verb+_presence._tcp.local+\
\PTR?
};
159 \draw[->
] (juliet) -- (thecloud) node
[pkt,pos=
0.4]{
160 \verb+juliet._presence.+\\
\verb+_tcp.local+
};
161 \draw[->
] (romeo) -- (thecloud) node
[pkt,pos=
0.4]{
162 \verb+romeo._presence.+\\
\verb+_tcp.local+
};
163 \draw[->
] (mercutio) -- (thecloud) node
[pkt,pos=
0.4]{
164 \verb+mercutio._presence.+\\
\verb+_tcp.local+
};
167 \item Service Instance Resolution
169 \node[cloud,draw,fill=gray!
20,aspect=
2] (thecloud) at (
0,
0)
{multicast
};
170 \node (node) at (-
\xhalf,
0)
{ \includegraphics[width=
3em
]{icon-computer.pdf
} };
171 \node (juliet) at (
\xhalf,
0)
{ \includegraphics[width=
3em
]{icon-computer.pdf
} };
172 \node[below=
\nodeskip of juliet.north,label
] (juliet text)
{ juliet
};
173 \draw[->
] (node) -- (thecloud) node
[pkt,pos=
0.5]{
174 \verb+juliet._presence._tcp.local+\
\SRV?
};
175 \draw[->
] (juliet) -- (thecloud) node
[pkt,pos=
0.5]{
176 \verb+juliet.local, port
5222,+\\
\verb+prio
0, weight
0+
};
181 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
182 \againframe<
3>
{subgoals
}
184 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
185 \begin{frame
}{XMPP (RFC
6122)
}
187 \column{.55\textwidth}
189 \begin{block
}{Extensible Messaging and Presence Protocol
}
192 \item Federated architecture
194 \item modeled after E-Mail
196 \item publish-subscribe mechanism
197 \item XMPP Extension Protocols (XEPs), e.\,g.
199 \item Multi-User Chats
% (XEP-0045)
200 \item Serverless Messaging
%(XEP-0174)
201 \item recently, also XEPs for the IoT
%(XEP-0323 through -0326)
207 \begin{block
}{Serverless XMPP (XEP-
0174)
}
209 \item Clients communicate directly, no server needed
210 \item service discovery via mDNS/DNS-SD
215 \column{.45\textwidth}
216 \tikzset{node distance=
0pt, >=stealth, thick, x=
3.5em, y=
2.8em
}
217 \tikzstyle{iconlabel
}=
[text width=
2.5cm, align=center,
218 font=
\fontsize{7.5pt
}{1em
}\selectfont]
219 \tikzstyle{label
}=
[font=
\fontsize{7pt
}{1em
}\selectfont]
222 \begin{tikzpicture
}[remember picture
]
223 \input{fig-xmpparch.tex
}
226 \tikz[remember picture,overlay
]
227 \draw<
2>
[<->,dotted
] (juliet) -- node
[anchor=south,label
]{serverless
} (romeo);
232 \begin{frame
}{XMPP (RFC
6122)
}
233 \begin{block
}{XEPs for the Internet of Things
}
235 \item XEP-
0323 Sensor Data
237 \item format for sensor data, query modes
239 \item XEP-
0324 Provisioning
241 \item defining access rights and user privileges
243 \item XEP-
0325 Control
245 \item get/set control prameters on a (group of) sensor node(s)
247 \item XEP-
0326 Concentrators
249 \item implement proxies for a subnet of the WSN
255 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
256 \againframe<
4>
{subgoals
}
258 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
259 \section{Chatty Things
}
260 \begin{frame
}{Chatty Things
}
262 \item use serverless XMPP + mDNS + DNS-SD for communication
263 \item interaction using a standard XMPP client
264 \item prevent information overflow
266 \item ``Traffic lights'': status icon in roster represents threshold value
267 \item \emph{Temporary Subscription for Presence (TSP)
}
269 %\item working prototype for Contiki on MSP430
271 \begin{block
}{Prototype
}
273 \item \emph{uBonjour
} for mDNS + DNS-SD
274 \item \emph{uXMPP
} for XMPP
275 \item 12~kB of ROM,
0.6 kB of RAM with Contiki on MSP-
430
280 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
281 \begin{frame
}{Temporary Subscription for Presence
}
282 \begin{block
}{Problem
}
284 \item node must manually subscribe to get information
285 \item users can move quickly out of the network
286 \item subscriptions become outdated
287 \item renewing/canceling subscriptions needs bandwidth
288 \item data publishers also get updates
293 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
294 \begin{frame
}{Temporary Subscription for Presence
}
295 \begin{block
}{Solution: Multi-User Chats
}
297 \item create one chat room per topic
298 \item users subscribe to information by entering the chat room
299 \item server only sends information to nodes who want it
301 \item Chatty Things send a flag that they're uninterested
305 \begin{block
}{Drawbacks
}
307 \item only works with central XMPP server
309 \item XEP-
0045 is not (yet) specified for serverless XMPP
311 \item XMPP server needs to handle TSP
316 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
317 \begin{frame
}{Bootstrapping
}
318 \begin{block
}{At Boot
}
320 \item activate uBonjour
321 \item try to discover a central XMPP server
323 \item DNS-SD:
\code{\_xmpp-client.
\_tcp.local
}
325 \item if an XMPP server is discovered:
\emph{Infrastructure mode
}
327 \item connect with ANONYMOUS login (XEP-
0175)
328 \item join topic-based chats
329 \item deactivate uBonjour
331 \item if no server is found:
\emph{Ad hoc mode
}
333 \item activate serverless messaging
338 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
339 \begin{frame
}{Bootstrapping
}
340 \begin{block
}{During Runtime
}
342 \item if server is lost, change to Ad hoc mode
343 \item if new server is found in Ad hod mode, try changing to Infrastructure
346 \item if that fails, stay in Ad hoc mode
352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
353 \againframe<
5>
{subgoals
}
355 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
356 \section{Related Approaches
}
357 \begin{frame
}{Related Approaches
}
360 \begin{block
}{Chatty Things
}
363 \begin{block
}{Constrained Application Protocol (CoAP)
}
365 \item binary mapping to HTTP
366 \item UDP with confirmation and congestion control
370 \begin{block
}{MQ Telemetry Transport (MQTT)
}
372 \item binary, only
2-byte header
373 \item focused on M2M communication
377 \begin{block
}{Web Service for Devices (WS4D)
}
379 \item SOAP (XML-based) over HTTP
385 \begin{tabular
}{|>
{\onslide<
1->
}l||>
{\onslide<
1->
}l|>
{\onslide<
2->
}l|
386 >
{\onslide<
3->
}l|>
{\onslide<
4->
}l<
{\onslide}|
}
388 Feature & Chatty Things & CoAP & MQTT & WS4D \\
390 application gateways & - & yes & yes & - \\
\hline
391 usable with standard clients & yes & - & - & (yes) \\
\hline
392 discovery support & yes & yes & - & yes\\
\hline
393 IPv6/
6LoWPAN ready & yes & yes & ? & partial \\
\hline
394 asynchronous messages & yes & yes & ? & ? \\
\hline
395 protocol overhead & moderate & low & low & high \\
\hline
400 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
402 \begin{frame
}{Conclusion
}
403 \begin{block
}{Advantages of Chatty Things
}
405 \item no need for central infrastructure
406 \item self-configuration and auto-discovery
407 \item interaction over standard chat clients
408 \item protocol flexibility for enhancements
411 \begin{block
}{Disadvantages of Chatty Things
}
413 \item XMPP introduces some complexity
414 \item topic filtering only possible with central server
419 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
422 \centering\LARGE{Questions?
}
426 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
436 \newcommand{\advanceby}[1]{%
437 \addtolength{\ypos}{#1}%
438 \addtolength{\yypos}{#1}%
439 \global\ypos=
\ypos% // see https://tex.stackexchange.com/questions/119730
440 \global\yypos=
\yypos%
444 below=-
.5\baselineskip,
447 dash pattern=on
2pt off
2pt,
449 \tikzstyle{clipkt
}=
[pkt,
450 below left=-
.5\baselineskip and
0cm,
453 \tikzstyle{devpkt
}=
[pkt,
454 below right=-
.5\baselineskip and
0cm,
458 \begin{frame
}[fragile,plain,t
]{Example: Sensor Data
}
460 every node/.style=
{fill=white, font=
\small},
461 every picture/.style=ultra thin,
465 \setlength{\ypos}{0cm
}
466 \setlength{\yypos}{.5cm
}
468 \draw (
\cli,
\top) node
[draw
]{Client
} -- (
\cli,
\nearlybot);
469 \draw[dashed
] (
\cli,
\nearlybot) -- (
\cli,
\bot);
470 \draw (
\dev,
\top) node
[draw
]{Device
} -- (
\dev,
\nearlybot);
471 \draw[dashed
] (
\dev,
\nearlybot) -- (
\dev,
\bot);
474 \draw[->
] (
\cli,-
\ypos) -- (
\dev,-
\yypos) node
[clipkt
]{\verb+<stream>+
};
476 \draw[->
] (
\dev,-
\ypos) -- (
\cli,-
\yypos) node
[devpkt
]{\verb+<stream>+
};
479 \draw[->
] (
\cli,-
\ypos) -- (
\dev,-
\yypos) node
[clipkt,align=left
]{
480 \verb+<iq type='get' id='
1'+\\
481 \verb+ to='dev@device.local/res'+\\
482 \verb+ from='client@client.local'>+\\
483 \verb+ <req xmlns='urn:xmpp:sn' seqnr='
1'+\\
484 \verb+ momentary='true'>+\\
485 \verb+ <node nodeId='Device04'/>+\\
486 \verb+ <field name='+
{\color{red
}\code{Energy
}}\verb+'/>+\\
487 \verb+ <field name='+
{\color{blue
}\code{Power
}}\verb+'/>+\\
490 \advanceby{9\baselineskip}
494 \draw[->
] (
\dev,-
\ypos) -- (
\cli,-
\yypos) node
[devpkt,align=left
]{
495 \verb+<iq type='result' id='
1'+\\
496 \verb+ from='dev@device.local'+\\
497 \verb+ to='client@client.local/res'>+\\
498 \verb+ <accepted xmlns='urn:xmpp:sn' seqnr='
1'/>+\\
500 \advanceby{4\baselineskip}
505 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
506 \begin{frame
}[fragile,plain,t
]{Example: Sensor Data (cont.)
}
508 every node/.style=
{fill=white, font=
\small},
509 every picture/.style=ultra thin,
513 \setlength{\ypos}{0cm
}
514 \setlength{\yypos}{.5cm
}
516 \draw[dashed
] (
\cli,
\top) node
[draw
]{Client
} -- (
\cli,
\nearlytop);
517 \draw (
\cli,
\nearlytop) -- (
\cli,
\bot);
518 \draw[dashed
] (
\dev,
\top) node
[draw
]{Device
} -- (
\dev,
\nearlytop);
519 \draw (
\dev,
\nearlytop) -- (
\dev,
\bot);
523 \draw[->
] (
\dev,-
\ypos) -- (
\cli,-
\yypos) node
[devpkt,align=left
]{
524 \verb+<message from='dev@device.local'+\\
525 \verb+ to='client@client.local/res'>+\\
526 \verb+ <fields xmlns='urn:xmpp:sn' seqnr='
1' done='true'>+\\
527 \verb+ <node nodeId='Device04'>+\\
528 \verb+ <timestamp value='
2013-
03-
07T22:
03:
15'>+\\
529 \verb+ <numeric name='+
{\color{red
}\code{Energy
}}\verb+' momentary='true'+\\
530 \verb+ value='+
{\color{red
}\code{167.5}}\verb+' unit='+
{\color{red
}\code{kWh
}}\verb+'/>+\\
531 \verb+ <numeric name='+
{\color{blue
}\code{Power
}}\verb+' momentary='true'+\\
532 \verb+ value='+
{\color{blue
}\code{239.4}}\verb+' unit='+
{\color{blue
}\code{W
}}\verb+'/>+\\
533 \verb+ </timestamp>+\\
537 \advanceby{12\baselineskip}
541 \draw[->
] (
\cli,-
\ypos) -- (
\dev,-
\yypos) node
[clipkt
]{\verb+</stream>+
};
543 \draw[->
] (
\dev,-
\ypos) -- (
\cli,-
\yypos) node
[devpkt
]{\verb+</stream>+
};