2 \usepackage[utf8
]{inputenc}
3 \usepackage[english
]{babel
}
5 \usepackage{inconsolata
}
8 \usepackage{cclicenses
}
10 \usetikzlibrary{arrows
}
11 \usetikzlibrary{arrows
}
12 \usetikzlibrary{positioning
}
13 \usetikzlibrary{shapes.symbols
}
14 %\usepackage[usenames,dvipsnames]{color}
16 %\presetkeys{todonotes}{inline}{}
17 \newcommand{\code}[1]{\texttt{#1}}
18 \definecolor{green
}{RGB
}{137,
164,
0} % from tubslatex
21 \subtitle{Making the Internet of Things Readily Usable for the Masses with XMPP
}
22 \author{Roland Hieber
}
23 \institute[IBR, TU BS
]{Institute of Operating Systems and Computer Networks, TU
25 \date[SKM-
13/
14]{Seminar Communications and Multimedia, WS
2013/
14}
33 \begin{frame
}{Contents
}
37 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39 \begin{frame
}{Motivation
}
40 \begin{block
}{The IoT Vision
}
42 \item plentitude of smart objects
43 \item interoperability between devices
44 \item easy accessibility for users
49 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50 \begin{frame
}<
1>
[label=subgoals
]{Motivation: Subgoals
}
51 \begin{block
}{But how do we
\ldots}
53 \item configure our devices?
55 \invisible<
1-
1>
{\item[\color{green
}\checkmark]\color{green
}
56 Link-Local Addressing, Stateless Address Autoconfiguration
}
58 \item find other nodes to talk to?
60 \invisible<
1-
2>
{\item[\color{green
}\checkmark]\color{green
}
63 \item talk to other nodes or users?
65 \invisible<
1-
3>
{\item[\color{green
}\checkmark]\color{green
} XMPP
68 \item filter relevant information?
70 \invisible<
1-
4>
{\item[\color{green
}\checkmark]\color{green
} ``Traffic
71 Lights'', Temporary Subscription for Presence
}
77 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
78 \section{Technologies for Distributed Networking
}
79 \begin{frame
}{Address Allocation
}
80 IPv4 Link-Local Addessing (``APIPA'', ``Zeroconf'', RFC
3927)
82 \item subnet
\code{169.254.0.0/
16}
84 IPv6 Stateless Address Autoconfiguration (RFC
4862)
86 \item subnet
\code{fe80::/
64} (link-local)
87 \item subnet
\code{fc00::/
11} (unique-local, if configured)
88 \item or global address (if configured)
91 \begin{block
}{Algorithm
}
93 \item choose (random) IP address in subnet
94 \item ask if anyone uses that address
95 \item if not, we're fine
101 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
102 \againframe<
2>
{subgoals
}
104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
105 \begin{frame
}{Multicast DNS (RFC
6762)
}
107 \item distributed DNS database
108 \item uses multicast address
\code{224.0.0.251} (IPv4) and
\code{ff02::fb
}
109 (IPv6), UDP port
5353
110 \item standard DNS packet format
111 \item hosts announce their own resources
112 \item hosts respond to queries if queried resource is known
116 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
117 \begin{frame
}{DNS-Based Service Discovery (RFC
6763)
}
120 \item Service Instance Enumeration
122 \item query PTR records of form
\code{\_service.
\_proto.domain
}
123 \item results: instance names of form
\code{name.
\_service.
\_proto.domain
}
125 \item Service Instance Resolution
127 \item query instance names as SRV records
128 \item result gives host name, port, priority, weight
133 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
134 \begin{frame
}[fragile
]{Example: mDNS + DNS-SD
}
135 \tikzset{font=
\fontsize{7.5pt
}{1em
}\selectfont, >=latex, thick, y=
3.5em
}
136 %\tikzstyle{iconlabel}=[text width=2cm, align=center,
137 %font=\fontsize{7.5pt}{1em}\selectfont]
138 \tikzstyle{label
}=
[font=
\fontsize{7pt
}{1em
}\selectfont]
139 \tikzstyle{pkt
}=
[font=
\fontsize{6pt
}{0.7em
}\selectfont,
140 draw,fill=white,dash pattern=on
2pt off
2pt, align=center,
142 \def\xhalf{.45\textwidth}
145 \item Service Instance Enumeration
147 \node[cloud,draw,fill=gray!
20,aspect=
2] (thecloud) at (
0,
0)
{multicast
};
149 node/
{(-
\xhalf,
0)
}/
{},
150 juliet/
{(
\xhalf,
0)
}/juliet,
151 romeo/
{(
\xhalf,-
1)
}/romeo,
152 mercutio/
{(
\xhalf,
1)
}/mercutio
%
154 \foreach \name/
\pos/
\text in
\nodelist {
155 \node (
\name) at
\pos { \includegraphics[width=
3em
]{icon-computer.pdf
} };
156 \node[below=
\nodeskip of
\name.north,label
] (
\name text)
{ \text };
158 \draw[->
] (node) -- (thecloud) node
[pkt,pos=
0.5]{
159 \verb+_presence._tcp.local+\
\PTR?
};
160 \draw[->
] (juliet) -- (thecloud) node
[pkt,pos=
0.4]{
161 \verb+juliet._presence.+\\
\verb+_tcp.local+
};
162 \draw[->
] (romeo) -- (thecloud) node
[pkt,pos=
0.4]{
163 \verb+romeo._presence.+\\
\verb+_tcp.local+
};
164 \draw[->
] (mercutio) -- (thecloud) node
[pkt,pos=
0.4]{
165 \verb+mercutio._presence.+\\
\verb+_tcp.local+
};
168 \item Service Instance Resolution
170 \node[cloud,draw,fill=gray!
20,aspect=
2] (thecloud) at (
0,
0)
{multicast
};
171 \node (node) at (-
\xhalf,
0)
{ \includegraphics[width=
3em
]{icon-computer.pdf
} };
172 \node (juliet) at (
\xhalf,
0)
{ \includegraphics[width=
3em
]{icon-computer.pdf
} };
173 \node[below=
\nodeskip of juliet.north,label
] (juliet text)
{ juliet
};
174 \draw[->
] (node) -- (thecloud) node
[pkt,pos=
0.5]{
175 \verb+juliet._presence._tcp.local+\
\SRV?
};
176 \draw[->
] (juliet) -- (thecloud) node
[pkt,pos=
0.5]{
177 \verb+juliet.local, port
5222,+\\
\verb+prio
0, weight
0+
};
182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
183 \againframe<
3>
{subgoals
}
185 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
186 \begin{frame
}{XMPP (RFC
6122)
}
188 \column{.55\textwidth}
190 \begin{block
}{Extensible Messaging and Presence Protocol
}
193 \item Federated architecture
195 \item modeled after E-Mail
197 \item publish-subscribe mechanism
198 \item XMPP Extension Protocols (XEPs), e.\,g.
200 \item Multi-User Chats
% (XEP-0045)
201 \item Serverless Messaging
%(XEP-0174)
202 \item recently, also XEPs for the IoT
%(XEP-0323 through -0326)
208 \begin{block
}{Serverless XMPP (XEP-
0174)
}
210 \item Clients communicate directly, no server needed
211 \item service discovery via mDNS/DNS-SD
216 \column{.45\textwidth}
217 \tikzset{node distance=
0pt, >=stealth, thick, x=
3.5em, y=
2.8em
}
218 \tikzstyle{iconlabel
}=
[text width=
2.5cm, align=center,
219 font=
\fontsize{7.5pt
}{1em
}\selectfont]
220 \tikzstyle{label
}=
[font=
\fontsize{7pt
}{1em
}\selectfont]
223 \begin{tikzpicture
}[remember picture
]
224 \input{fig-xmpparch.tex
}
227 \tikz[remember picture,overlay
]
228 \draw<
2>
[<->,dotted
] (juliet) -- node
[anchor=south,label
]{serverless
} (romeo);
233 \begin{frame
}{XMPP (RFC
6122)
}
234 \begin{block
}{XEPs for the Internet of Things
}
236 \item XEP-
0323 Sensor Data
238 \item format for sensor data, query modes
240 \item XEP-
0324 Provisioning
242 \item defining access rights and user privileges
244 \item XEP-
0325 Control
246 \item get/set control prameters on a (group of) sensor node(s)
248 \item XEP-
0326 Concentrators
250 \item implement proxies for a subnet of the WSN
256 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
257 \againframe<
4>
{subgoals
}
259 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
260 \section{Chatty Things
}
261 \begin{frame
}{Chatty Things
}
263 \item use serverless XMPP + mDNS + DNS-SD for communication
264 \item interaction using a standard XMPP client
265 \item prevent information overflow
267 \item ``Traffic lights'': status icon in roster represents threshold value
268 \item \emph{Temporary Subscription for Presence (TSP)
}
270 %\item working prototype for Contiki on MSP430
272 \begin{block
}{Prototype
}
274 \item \emph{uBonjour
} for mDNS + DNS-SD
275 \item \emph{uXMPP
} for XMPP
276 \item 12~kB of ROM,
0.6 kB of RAM with Contiki on MSP-
430
281 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
282 \begin{frame
}{Temporary Subscription for Presence
}
283 \begin{block
}{Problem
}
285 \item node must manually subscribe to get information
286 \item users can move quickly out of the network
287 \item subscriptions become outdated
288 \item renewing/canceling subscriptions needs bandwidth
289 \item data publishers also get updates
294 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
295 \begin{frame
}{Temporary Subscription for Presence
}
296 \begin{block
}{Solution: Multi-User Chats
}
298 \item create one chat room per topic
299 \item users subscribe to information by entering the chat room
300 \item server only sends information to nodes who want it
302 \item Chatty Things send a flag that they're uninterested
306 \begin{block
}{Drawbacks
}
308 \item only works with central XMPP server
310 \item XEP-
0045 is not (yet) specified for serverless XMPP
312 \item XMPP server needs to handle TSP
317 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
318 \begin{frame
}{Bootstrapping
}
319 \begin{block
}{At Boot
}
321 \item activate uBonjour
322 \item try to discover a central XMPP server
324 \item DNS-SD:
\code{\_xmpp-client.
\_tcp.local
}
326 \item if an XMPP server is discovered:
\emph{Infrastructure mode
}
328 \item connect with ANONYMOUS login (XEP-
0175)
329 \item join topic-based chats
330 \item deactivate uBonjour
332 \item if no server is found:
\emph{Ad hoc mode
}
334 \item activate serverless messaging
339 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
340 \begin{frame
}{Bootstrapping
}
341 \begin{block
}{During Runtime
}
343 \item if server is lost, change to Ad hoc mode
344 \item if new server is found in Ad hod mode, try changing to Infrastructure
347 \item if that fails, stay in Ad hoc mode
353 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
354 \againframe<
5>
{subgoals
}
356 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
357 \section{Related Approaches
}
358 \begin{frame
}{Related Approaches
}
361 \begin{block
}{Chatty Things
}
364 \begin{block
}{Constrained Application Protocol (CoAP)
}
366 \item binary mapping to HTTP
367 \item UDP with confirmation and congestion control
371 \begin{block
}{MQ Telemetry Transport (MQTT)
}
373 \item binary, only
2-byte header
374 \item focused on M2M communication
378 \begin{block
}{Web Service for Devices (WS4D)
}
380 \item SOAP (XML-based) over HTTP
386 \begin{tabular
}{|>
{\onslide<
1->
}l||>
{\onslide<
1->
}l|>
{\onslide<
2->
}l|
387 >
{\onslide<
3->
}l|>
{\onslide<
4->
}l<
{\onslide}|
}
389 Feature & Chatty Things & CoAP & MQTT & WS4D \\
391 application gateways & - & yes & yes & - \\
\hline
392 usable with standard clients & yes & - & - & (yes) \\
\hline
393 discovery support & yes & yes & - & yes\\
\hline
394 IPv6/
6LoWPAN ready & yes & yes & ? & partial \\
\hline
395 asynchronous messages & yes & yes & ? & ? \\
\hline
396 protocol overhead & moderate & low & low & high \\
\hline
401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
403 \begin{frame
}{Conclusion
}
404 \begin{block
}{Advantages of Chatty Things
}
406 \item no need for central infrastructure
407 \item self-configuration and auto-discovery
408 \item interaction over standard chat clients
409 \item protocol flexibility for enhancements
412 \begin{block
}{Disadvantages of Chatty Things
}
414 \item XMPP introduces some complexity
415 \item topic filtering only possible with central server
420 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
429 This presentation is licensed under CC-BY-NC-SA-
3.0\\
430 and builds on icons from the Tango Desktop Project
434 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
444 \newcommand{\advanceby}[1]{%
445 \addtolength{\ypos}{#1}%
446 \addtolength{\yypos}{#1}%
447 \global\ypos=
\ypos% // see https://tex.stackexchange.com/questions/119730
448 \global\yypos=
\yypos%
452 below=-
.5\baselineskip,
455 dash pattern=on
2pt off
2pt,
457 \tikzstyle{clipkt
}=
[pkt,
458 below left=-
.5\baselineskip and
0cm,
461 \tikzstyle{devpkt
}=
[pkt,
462 below right=-
.5\baselineskip and
0cm,
466 \begin{frame
}[fragile,plain,t
]{Example: Sensor Data
}
468 every node/.style=
{fill=white, font=
\small},
469 every picture/.style=ultra thin,
473 \setlength{\ypos}{0cm
}
474 \setlength{\yypos}{.5cm
}
476 \draw (
\cli,
\top) node
[draw
]{Client
} -- (
\cli,
\nearlybot);
477 \draw[dashed
] (
\cli,
\nearlybot) -- (
\cli,
\bot);
478 \draw (
\dev,
\top) node
[draw
]{Device
} -- (
\dev,
\nearlybot);
479 \draw[dashed
] (
\dev,
\nearlybot) -- (
\dev,
\bot);
482 \draw[->
] (
\cli,-
\ypos) -- (
\dev,-
\yypos) node
[clipkt
]{\verb+<stream>+
};
484 \draw[->
] (
\dev,-
\ypos) -- (
\cli,-
\yypos) node
[devpkt
]{\verb+<stream>+
};
487 \draw[->
] (
\cli,-
\ypos) -- (
\dev,-
\yypos) node
[clipkt,align=left
]{
488 \verb+<iq type='get' id='
1'+\\
489 \verb+ to='dev@device.local/res'+\\
490 \verb+ from='client@client.local'>+\\
491 \verb+ <req xmlns='urn:xmpp:sn' seqnr='
1'+\\
492 \verb+ momentary='true'>+\\
493 \verb+ <node nodeId='Device04'/>+\\
494 \verb+ <field name='+
{\color{red
}\code{Energy
}}\verb+'/>+\\
495 \verb+ <field name='+
{\color{blue
}\code{Power
}}\verb+'/>+\\
498 \advanceby{9\baselineskip}
502 \draw[->
] (
\dev,-
\ypos) -- (
\cli,-
\yypos) node
[devpkt,align=left
]{
503 \verb+<iq type='result' id='
1'+\\
504 \verb+ from='dev@device.local'+\\
505 \verb+ to='client@client.local/res'>+\\
506 \verb+ <accepted xmlns='urn:xmpp:sn' seqnr='
1'/>+\\
508 \advanceby{4\baselineskip}
513 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
514 \begin{frame
}[fragile,plain,t
]{Example: Sensor Data (cont.)
}
516 every node/.style=
{fill=white, font=
\small},
517 every picture/.style=ultra thin,
521 \setlength{\ypos}{0cm
}
522 \setlength{\yypos}{.5cm
}
524 \draw[dashed
] (
\cli,
\top) node
[draw
]{Client
} -- (
\cli,
\nearlytop);
525 \draw (
\cli,
\nearlytop) -- (
\cli,
\bot);
526 \draw[dashed
] (
\dev,
\top) node
[draw
]{Device
} -- (
\dev,
\nearlytop);
527 \draw (
\dev,
\nearlytop) -- (
\dev,
\bot);
531 \draw[->
] (
\dev,-
\ypos) -- (
\cli,-
\yypos) node
[devpkt,align=left
]{
532 \verb+<message from='dev@device.local'+\\
533 \verb+ to='client@client.local/res'>+\\
534 \verb+ <fields xmlns='urn:xmpp:sn' seqnr='
1' done='true'>+\\
535 \verb+ <node nodeId='Device04'>+\\
536 \verb+ <timestamp value='
2013-
03-
07T22:
03:
15'>+\\
537 \verb+ <numeric name='+
{\color{red
}\code{Energy
}}\verb+' momentary='true'+\\
538 \verb+ value='+
{\color{red
}\code{167.5}}\verb+' unit='+
{\color{red
}\code{kWh
}}\verb+'/>+\\
539 \verb+ <numeric name='+
{\color{blue
}\code{Power
}}\verb+' momentary='true'+\\
540 \verb+ value='+
{\color{blue
}\code{239.4}}\verb+' unit='+
{\color{blue
}\code{W
}}\verb+'/>+\\
541 \verb+ </timestamp>+\\
545 \advanceby{12\baselineskip}
549 \draw[->
] (
\cli,-
\ypos) -- (
\dev,-
\yypos) node
[clipkt
]{\verb+</stream>+
};
551 \draw[->
] (
\dev,-
\ypos) -- (
\cli,-
\yypos) node
[devpkt
]{\verb+</stream>+
};