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 \useoutertheme[section
]{tubs
}
16 \setbeamertemplate{itemize items
}[tusquare
]
18 %\presetkeys{todonotes}{inline}{}
19 \newcommand{\code}[1]{\texttt{#1}}
20 \definecolor{tu-green
}{RGB
}{137,
164,
0} % from tubslatex
23 \subtitle{Making the Internet of Things Readily Usable for the Masses with XMPP
}
24 \author{Roland Hieber
}
25 \institute[IBR, TU-BS
]{Institute of Operating Systems and Computer Networks
}
26 \date[SKM-
13/
14]{Seminar Communications and Multimedia, WS
2013/
14}
35 \begin{frame
}{Contents
}
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
41 \begin{frame
}{Motivation
}
42 \begin{block
}{The IoT Vision
}
44 \item plentitude of smart objects
45 \item interoperability between devices
46 \item easy accessibility for users
51 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
52 \begin{frame
}<
1>
[label=subgoals
]{Motivation: Subgoals
}
53 \begin{block
}{But how do we
\ldots}
55 \item configure our devices?
57 \invisible<
1-
1>
{\item[\color{tu-green
}\checkmark]\color{tu-green
}
58 Link-Local Addressing, Stateless Address Autoconfiguration
}
60 \item find other nodes to talk to?
62 \invisible<
1-
2>
{\item[\color{tu-green
}\checkmark]\color{tu-green
}
65 \item talk to other nodes or users?
67 \invisible<
1-
3>
{\item[\color{tu-green
}\checkmark]\color{tu-green
} XMPP
70 \item filter relevant information?
72 \invisible<
1-
4>
{\item[\color{tu-green
}\checkmark]\color{tu-green
} ``Traffic
73 Lights'', Temporary Subscription for Presence
}
79 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
80 \section{Technologies for Distributed Networking
}
81 \begin{frame
}{Address Allocation
}
82 IPv4 Link-Local Addessing (``APIPA'', ``Zeroconf'', RFC
3927)
84 \item subnet
\code{169.254.0.0/
16}
86 IPv6 Stateless Address Autoconfiguration (RFC
4862)
88 \item subnet
\code{fe80::/
64} (link-local)
89 \item subnet
\code{fc00::/
11} (unique-local, if configured)
90 \item or global address (if configured)
93 \begin{block
}{Algorithm
}
95 \item choose (random) IP address in subnet
96 \item ask if anyone uses that address
97 \item if not, we're fine
103 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
104 \againframe<
2>
{subgoals
}
106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
107 \begin{frame
}{Multicast DNS (RFC
6762)
}
109 \item distributed DNS database
110 \item uses multicast address
\code{224.0.0.251} (IPv4) and
\code{ff02::fb
}
111 (IPv6), UDP port
5353
112 \item standard DNS packet format
113 \item hosts announce their own resources
114 \item hosts respond to queries if queried resource is known
118 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
119 \begin{frame
}{DNS-Based Service Discovery (RFC
6763)
}
122 \item Service Instance Enumeration
124 \item query PTR records of form
\code{\_service.
\_proto.domain
}
125 \item results: instance names of form
\code{name.
\_service.
\_proto.domain
}
127 \item Service Instance Resolution
129 \item query instance names as SRV records
130 \item result gives host name, port, priority, weight
135 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
136 \begin{frame
}[fragile
]{mDNS + DNS-SD
}
137 \tikzset{font=
\fontsize{7.5pt
}{1em
}\selectfont, >=latex, thick, y=
3.5em
}
138 %\tikzstyle{iconlabel}=[text width=2cm, align=center,
139 %font=\fontsize{7.5pt}{1em}\selectfont]
140 \tikzstyle{label
}=
[font=
\fontsize{7pt
}{1em
}\selectfont]
141 \tikzstyle{pkt
}=
[font=
\fontsize{7pt
}{1em
}\selectfont,
142 draw,fill=white,dash pattern=on
2pt off
2pt, align=center,
144 \def\xhalf{.45\textwidth}
147 \item Service Instance Enumeration
149 \node[cloud,draw,fill=gray!
20,aspect=
2] (thecloud) at (
0,
0)
{multicast
};
151 node/
{(-
\xhalf,
0)
}/
{},
152 juliet/
{(
\xhalf,
0)
}/juliet,
153 romeo/
{(
\xhalf,-
1)
}/romeo,
154 mercutio/
{(
\xhalf,
1)
}/mercutio
%
156 \foreach \name/
\pos/
\text in
\nodelist {
157 \node (
\name) at
\pos { \includegraphics[width=
3em
]{icon-computer.pdf
} };
158 \node[below=
\nodeskip of
\name.north,label
] (
\name text)
{ \text };
160 \draw[->
] (node) -- (thecloud) node
[pkt,pos=
0.5]{
161 \verb+_presence._tcp.local+\
\PTR?
};
162 \draw[->
] (juliet) -- (thecloud) node
[pkt,pos=
0.35]{
163 \verb+juliet._presence.+\\
\verb+_tcp.local+
};
164 \draw[->
] (romeo) -- (thecloud) node
[pkt,pos=
0.35]{
165 \verb+romeo._presence.+\\
\verb+_tcp.local+
};
166 \draw[->
] (mercutio) -- (thecloud) node
[pkt,pos=
0.35]{
167 \verb+mercutio._presence.+\\
\verb+_tcp.local+
};
170 \item Service Instance Resolution
172 \node[cloud,draw,fill=gray!
20,aspect=
2] (thecloud) at (
0,
0)
{multicast
};
173 \node (node) at (-
\xhalf,
0)
{ \includegraphics[width=
3em
]{icon-computer.pdf
} };
174 \node (juliet) at (
\xhalf,
0)
{ \includegraphics[width=
3em
]{icon-computer.pdf
} };
175 \node[below=
\nodeskip of juliet.north,label
] (juliet text)
{ juliet
};
176 \draw[->
] (node) -- (thecloud) node
[pkt,pos=
0.5]{
177 \verb+juliet._presence._tcp.local+\
\SRV?
};
178 \draw[->
] (juliet) -- (thecloud) node
[pkt,pos=
0.5]{
179 \verb+juliet.local, port
5222,+\\
\verb+prio
0, weight
0+
};
182 %\node[draw] (resptr) at (0,-4) {\code{juliet.\_presence.\_tcp.local} SRV?};
183 %\node[draw] (resres) at (16em,-4) {\code{juliet.local, port 5222, prio 0, weight 0}};
185 %\draw[->] (enumptr) -- (enumres);
186 %\draw[->] (resptr) -- (resres);
191 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
192 \againframe<
3>
{subgoals
}
194 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
195 \begin{frame
}{XMPP (RFC
6122)
}
197 \column{.55\textwidth}
199 \begin{block
}{Extensible Messaging and Presence Protocol
}
202 \item Federated architecture
204 \item modeled after E-Mail
206 \item publish-subscribe mechanism
207 \item XMPP Extension Protocols (XEPs), e.\,g.
209 \item Multi-User Chats
% (XEP-0045)
210 \item Serverless Messaging
%(XEP-0174)
211 \item recently, also XEPs for the IoT
%(XEP-0323 through -0326)
217 \begin{block
}{Serverless XMPP (XEP-
0174)
}
219 \item Clients communicate directly, no server needed
220 \item service discovery via mDNS/DNS-SD
225 \column{.45\textwidth}
226 \tikzset{node distance=
0pt, >=stealth, thick, x=
3.5em, y=
2.8em
}
227 \tikzstyle{iconlabel
}=
[text width=
2.5cm, align=center,
228 font=
\fontsize{7.5pt
}{1em
}\selectfont]
229 \tikzstyle{label
}=
[font=
\fontsize{7pt
}{1em
}\selectfont]
232 \begin{tikzpicture
}[remember picture
]
233 \input{fig-xmpparch.tex
}
236 \tikz[remember picture,overlay
]
237 \draw<
2>
[<->,dotted
] (juliet) -- node
[anchor=south,label
]{serverless
} (romeo);
242 \begin{frame
}{XMPP (RFC
6122)
}
243 \begin{block
}{XEPs for the Internet of Things
}
245 \item XEP-
0323 Sensor Data
247 \item format for sensor data, query modes
249 \item XEP-
0324 Provisioning
251 \item defining access rights and user privileges
253 \item XEP-
0325 Control
255 \item get/set control prameters on a (group of) sensor node(s)
257 \item XEP-
0326 Concentrators
259 \item implement proxies for a subnet of the WSN
265 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
266 \againframe<
4>
{subgoals
}
268 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
269 \section{Chatty Things
}
270 \begin{frame
}{Chatty Things
}
272 \item use serverless XMPP + mDNS + DNS-SD for communication
273 \item interaction using a standard XMPP client
274 \item prevent information overflow
276 \item ``Traffic lights'': status icon in roster represents threshold value
277 \item \emph{Temporary Subscription for Presence (TSP)
}
279 %\item working prototype for Contiki on MSP430
281 \begin{block
}{Prototype
}
283 \item \emph{uBonjour
} for mDNS + DNS-SD
284 \item \emph{uXMPP
} for XMPP
285 \item 12~kB of ROM,
0.6 kB of RAM with Contiki on MSP-
430
290 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
291 \begin{frame
}{Temporary Subscription for Presence
}
292 \begin{block
}{Problem
}
294 \item node must manually subscribe to get information
295 \item users can move quickly out of the network
296 \item subscriptions become outdated
297 \item renewing/canceling subscriptions needs bandwidth
298 \item data publishers also get updates
303 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
304 \begin{frame
}{Temporary Subscription for Presence
}
305 \begin{block
}{Solution: Multi-User Chats
}
307 \item create one chat room per topic
308 \item users subscribe to information by entering the chat room
309 \item server only sends information to nodes who want it
311 \item Chatty Things send a flag that they're uninterested
315 \begin{block
}{Drawbacks
}
317 \item only works with central XMPP server
319 \item XEP-
0045 is not (yet) specified for serverless XMPP
321 \item XMPP server needs to handle TSP
326 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
327 \begin{frame
}{Bootstrapping
}
328 \begin{block
}{At Boot
}
330 \item activate uBonjour
331 \item try to discover a central XMPP server
333 \item DNS-SD:
\code{\_xmpp-client.
\_tcp.local
}
335 \item if an XMPP server is discovered:
\emph{Infrastructure mode
}
337 \item connect with ANONYMOUS login (XEP-
0175)
338 \item join topic-based chats
339 \item deactivate uBonjour
341 \item if no server is found:
\emph{Ad hoc mode
}
343 \item activate serverless messaging
348 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
349 \begin{frame
}{Bootstrapping
}
350 \begin{block
}{During Runtime
}
352 \item if server is lost, change to Ad hoc mode
353 \item if new server is found in Ad hod mode, try changing to Infrastructure
356 \item if that fails, stay in Ad hoc mode
362 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
363 \againframe<
5>
{subgoals
}
365 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
366 \section{Related Approaches
}
367 \begin{frame
}{Related Approaches
}
370 \begin{block
}{Chatty Things
}
373 \begin{block
}{Constrained Application Protocol (CoAP)
}
375 \item binary mapping to HTTP
376 \item UDP with confirmation and congestion control
380 \begin{block
}{MQ Telemetry Transport (MQTT)
}
382 \item binary, only
2-byte header
383 \item focused on M2M communication
387 \begin{block
}{Web Service for Devices (WS4D)
}
389 \item SOAP (XML-based) over HTTP
395 \begin{tabular
}{|>
{\onslide<
1->
}l||>
{\onslide<
1->
}l|>
{\onslide<
2->
}l|
396 >
{\onslide<
3->
}l|>
{\onslide<
4->
}l<
{\onslide}|
}
398 Feature & Chatty Things & CoAP & MQTT & WS4D \\
400 application gateways & - & yes & yes & - \\
\hline
401 usable with standard clients & yes & - & - & (yes) \\
\hline
402 discovery support & yes & yes & - & yes\\
\hline
403 IPv6/
6LoWPAN ready & yes & yes & ? & partial \\
\hline
404 asynchronous messages & yes & yes & ? & ? \\
\hline
405 protocol overhead & moderate & low & low & high \\
\hline
410 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
412 \begin{frame
}{Conclusion
}
413 \begin{block
}{Advantages of Chatty Things
}
415 \item no need for central infrastructure
416 \item self-configuration and auto-discovery
417 \item interaction over standard chat clients
418 \item protocol flexibility for enhancements
421 \begin{block
}{Disadvantages of Chatty Things
}
423 \item XMPP introduces some complexity
424 \item topic filtering only possible with central server
429 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
432 \centering\LARGE{Questions?
}
436 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
446 \newcommand{\advanceby}[1]{%
447 \addtolength{\ypos}{#1}%
448 \addtolength{\yypos}{#1}%
449 \global\ypos=
\ypos% // see https://tex.stackexchange.com/questions/119730
450 \global\yypos=
\yypos%
454 below=-
.5\baselineskip,
457 dash pattern=on
2pt off
2pt,
459 \tikzstyle{clipkt
}=
[pkt,
460 below left=-
.5\baselineskip and
0cm,
463 \tikzstyle{devpkt
}=
[pkt,
464 below right=-
.5\baselineskip and
0cm,
468 \begin{frame
}[fragile,plain,t
]{Example: Sensor Data
}
470 every node/.style=
{fill=white, font=
\small},
471 every picture/.style=ultra thin,
475 \setlength{\ypos}{0cm
}
476 \setlength{\yypos}{.5cm
}
478 \draw (
\cli,
\top) node
[draw
]{Client
} -- (
\cli,
\nearlybot);
479 \draw[dashed
] (
\cli,
\nearlybot) -- (
\cli,
\bot);
480 \draw (
\dev,
\top) node
[draw
]{Device
} -- (
\dev,
\nearlybot);
481 \draw[dashed
] (
\dev,
\nearlybot) -- (
\dev,
\bot);
484 \draw[->
] (
\cli,-
\ypos) -- (
\dev,-
\yypos) node
[clipkt
]{\verb+<stream>+
};
486 \draw[->
] (
\dev,-
\ypos) -- (
\cli,-
\yypos) node
[devpkt
]{\verb+<stream>+
};
489 \draw[->
] (
\cli,-
\ypos) -- (
\dev,-
\yypos) node
[clipkt,align=left
]{
490 \verb+<iq type='get' id='
1'+\\
491 \verb+ to='dev@device.local/res'+\\
492 \verb+ from='client@client.local'>+\\
493 \verb+ <req xmlns='urn:xmpp:sn' seqnr='
1'+\\
494 \verb+ momentary='true'>+\\
495 \verb+ <node nodeId='Device04'/>+\\
496 \verb+ <field name='+
{\color{tu-red
}\code{Energy
}}\verb+'/>+\\
497 \verb+ <field name='+
{\color{dark-blue
}\code{Power
}}\verb+'/>+\\
500 \advanceby{9\baselineskip}
504 \draw[->
] (
\dev,-
\ypos) -- (
\cli,-
\yypos) node
[devpkt,align=left
]{
505 \verb+<iq type='result' id='
1'+\\
506 \verb+ from='dev@device.local'+\\
507 \verb+ to='client@client.local/res'>+\\
508 \verb+ <accepted xmlns='urn:xmpp:sn' seqnr='
1'/>+\\
510 \advanceby{4\baselineskip}
515 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
516 \begin{frame
}[fragile,plain,t
]{Example: Sensor Data (cont.)
}
518 every node/.style=
{fill=white, font=
\small},
519 every picture/.style=ultra thin,
523 \setlength{\ypos}{0cm
}
524 \setlength{\yypos}{.5cm
}
526 \draw[dashed
] (
\cli,
\top) node
[draw
]{Client
} -- (
\cli,
\nearlytop);
527 \draw (
\cli,
\nearlytop) -- (
\cli,
\bot);
528 \draw[dashed
] (
\dev,
\top) node
[draw
]{Device
} -- (
\dev,
\nearlytop);
529 \draw (
\dev,
\nearlytop) -- (
\dev,
\bot);
533 \draw[->
] (
\dev,-
\ypos) -- (
\cli,-
\yypos) node
[devpkt,align=left
]{
534 \verb+<message from='dev@device.local'+\\
535 \verb+ to='client@client.local/res'>+\\
536 \verb+ <fields xmlns='urn:xmpp:sn' seqnr='
1' done='true'>+\\
537 \verb+ <node nodeId='Device04'>+\\
538 \verb+ <timestamp value='
2013-
03-
07T22:
03:
15'>+\\
539 \verb+ <numeric name='+
{\color{tu-red
}\code{Energy
}}\verb+' momentary='true'+\\
540 \verb+ value='+
{\color{tu-red
}\code{167.5}}\verb+' unit='+
{\color{tu-red
}\code{kWh
}}\verb+'/>+\\
541 \verb+ <numeric name='+
{\color{dark-blue
}\code{Power
}}\verb+' momentary='true'+\\
542 \verb+ value='+
{\color{dark-blue
}\code{239.4}}\verb+' unit='+
{\color{dark-blue
}\code{W
}}\verb+'/>+\\
543 \verb+ </timestamp>+\\
547 \advanceby{12\baselineskip}
551 \draw[->
] (
\cli,-
\ypos) -- (
\dev,-
\yypos) node
[clipkt
]{\verb+</stream>+
};
553 \draw[->
] (
\dev,-
\ypos) -- (
\cli,-
\yypos) node
[devpkt
]{\verb+</stream>+
};