No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0347.xml 93KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!-- TODO: Sub-namespace for Registration Clients.
  3. urn:xmpp:iot:discovery:regunit - Registration Units (can claim ownership)
  4. -->
  5. <!-- TODO: TBD items -->
  6. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  7. <!ENTITY % ents SYSTEM 'xep.ent'>
  8. %ents;
  9. ]>
  10. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  11. <xep>
  12. <header>
  13. <title>Internet of Things - Discovery</title>
  14. <abstract>This specification describes an architecture based on the XMPP protocol whereby Things can be installed and safely discovered by their owners and connected into networks of Things.</abstract>
  15. &LEGALNOTICE;
  16. <number>0347</number>
  17. <status>Deferred</status>
  18. <type>Standards Track</type>
  19. <sig>Standards</sig>
  20. <approver>Council</approver>
  21. <dependencies>
  22. <spec>XMPP Core</spec>
  23. <spec>XEP-0001</spec>
  24. <spec>XEP-0030</spec>
  25. <spec>XEP-0077</spec>
  26. <spec>XEP-0114</spec>
  27. <spec>XEP-0174</spec>
  28. <spec>XEP-0323</spec>
  29. <spec>XEP-0324</spec>
  30. <spec>XEP-0325</spec>
  31. <spec>XEP-0326</spec>
  32. </dependencies>
  33. <supersedes/>
  34. <supersededby/>
  35. <shortname>iot-discovery</shortname>
  36. &peterwaher;
  37. <author>
  38. <firstname>Ronny</firstname>
  39. <surname>Klauck</surname>
  40. <email>rklauck@informatik.tu-cottbus.de</email>
  41. <jid>TBD</jid>
  42. <uri>http://www-rnks.informatik.tu-cottbus.de/~rklauck</uri>
  43. </author>
  44. <revision>
  45. <version>0.5</version>
  46. <date>2017-09-11</date>
  47. <initials>XEP Editor (jwi)</initials>
  48. <remark>Defer due to lack of activity.</remark>
  49. </revision>
  50. <revision>
  51. <version>0.4.1</version>
  52. <date>2016-08-20</date>
  53. <initials>XSF Editor: ssw</initials>
  54. <remark>Replace external image with data URI.</remark>
  55. </revision>
  56. <revision>
  57. <version>0.4</version>
  58. <date>2015-11-09</date>
  59. <initials>pw</initials>
  60. <remark>
  61. <p>Updated contact information.</p>
  62. <p>Updated example JIDs to example.org</p>
  63. </remark>
  64. </revision>
  65. <revision>
  66. <version>0.3</version>
  67. <date>2014-11-11</date>
  68. <initials>pw</initials>
  69. <remark>
  70. <p>
  71. Added the possibility for <link url='#ownerupdate'>owners to update meta-data about its things</link>.
  72. This is done through the optional attribute <strong>jid</strong> on the <strong>update</strong> element.
  73. </p>
  74. <p>Added <strong>ROOM</strong> to the <link url='#tags'>list of predefined tag names</link>.</p>
  75. <p>Added anchors to section headers.</p>
  76. </remark>
  77. </revision>
  78. <revision>
  79. <version>0.2</version>
  80. <date>2014-09-07</date>
  81. <initials>pw</initials>
  82. <remark>
  83. <p>Added a small note regarding URL encoding of hash signs, and corrected the Google Chart URL example.</p>
  84. </remark>
  85. </revision>
  86. <revision>
  87. <version>0.1</version>
  88. <date>2014-04-10</date>
  89. <initials>editor (mam)</initials>
  90. <remark>
  91. <p>Initial published version approved by XMPP Council.</p>
  92. </remark>
  93. </revision>
  94. <revision>
  95. <version>0.0.3</version>
  96. <date>2014-04-09</date>
  97. <initials>pw</initials>
  98. <remark>
  99. <p>Introduced possibility for hosting Thing Registry as a Jabber Server Component, using XEP-0114.</p>
  100. <p>
  101. Expanded de section <link url='#support'>Determining Support</link>, explaining how to search through server components.
  102. </p>
  103. <p>Removed the possibility to search for nick names, as a way of finding Thing Registries.</p>
  104. <p>Added Security and Implementation Notes describing the pros and cons of hosting a Thing Registry as a Server Component vs. as a Client.</p>
  105. </remark>
  106. </revision>
  107. <revision>
  108. <version>0.0.2</version>
  109. <date>2014-04-07</date>
  110. <initials>pw</initials>
  111. <remark>
  112. <p>Removed any hard-coded account names.</p>
  113. </remark>
  114. </revision>
  115. <revision>
  116. <version>0.0.1</version>
  117. <date>2014-03-11</date>
  118. <initials>pw,rk</initials>
  119. <remark>
  120. <p>First draft.</p>
  121. </remark>
  122. </revision>
  123. </header>
  124. <section1 topic='Introduction' anchor='intro'>
  125. <p>
  126. When installing massive amounts of Things into public networks care has to be taken to make installation simple, but at the same time secure so that the Things cannot be
  127. hijacked or hacked, making sure access to the Thing is controlled by the physical owner of the Thing. One of the main problems is how
  128. to match the characteristics of a Thing, like serial number, manufacturer, model, etc., with information automatically created by the Thing itself, like perhaps its JID, in
  129. an environment with massive amount of Things without rich user interfaces. Care has also to be taken when specifying rules for access rights and user privileges.
  130. </p>
  131. <p>
  132. This document provides a network architecture based on the XMPP protocol that provides a means to safely install, configure, find and connect massive amounts of Things together, and
  133. at the same time minimizing the risk that Things get hijacked. It also provides information how each individual step in the process can be performed with as little manual intervention
  134. as possible, aiming where possible at zero-configuration networking. Furthermore, this document specifies how to create a registry that allows simple access to public Things
  135. without risking their integrity unnecessarily.
  136. </p>
  137. <p>
  138. Internet of Things contains many different architectures and use cases. For this reason, the IoT standards have been divided into multiple XEPs according to the following table:
  139. </p>
  140. <table caption='Internet of Things XEPs'>
  141. <tr>
  142. <th>XEP</th>
  143. <th>Description</th>
  144. </tr>
  145. <tr>
  146. <td>xep-0000-IoT-BatteryPoweredSensors</td>
  147. <td>Defines how to handle the peculiars related to battery powered devices, and other devices intermittently available on the network.</td>
  148. </tr>
  149. <tr>
  150. <td>xep-0000-IoT-Events</td>
  151. <td>Defines how Things send events, how event subscription, hysteresis levels, etc., are configured.</td>
  152. </tr>
  153. <tr>
  154. <td>xep-0000-IoT-Interoperability</td>
  155. <td>Defines guidelines for how to achieve interoperability in Internet of Things, publishing interoperability interfaces for different types of devices.</td>
  156. </tr>
  157. <tr>
  158. <td>xep-0000-IoT-Multicast</td>
  159. <td>Defines how sensor data can be multicast in efficient ways.</td>
  160. </tr>
  161. <tr>
  162. <td>xep-0000-IoT-PubSub</td>
  163. <td>Defines how efficient publication of sensor data can be made in Internet of Things.</td>
  164. </tr>
  165. <tr>
  166. <td>xep-0000-IoT-Chat</td>
  167. <td>Defines how human-to-machine interfaces should be constructed using chat messages to be user friendly, automatable and consistent with other IoT extensions and possible underlying architecture.</td>
  168. </tr>
  169. <tr>
  170. <td>XEP-0322</td>
  171. <td>
  172. Defines how to EXI can be used in XMPP to achieve efficient compression of data. Albeit not an Internet of Things specific XEP, this XEP should be considered
  173. in all Internet of Things implementations where memory and packet size is an issue.
  174. </td>
  175. </tr>
  176. <tr>
  177. <td>XEP-0323</td>
  178. <td>
  179. Provides the underlying architecture, basic operations and data structures for sensor data communication over XMPP networks.
  180. It includes a hardware abstraction model, removing any technical detail implemented in underlying technologies. This XEP is used by all other
  181. Internet of Things XEPs.
  182. </td>
  183. </tr>
  184. <tr>
  185. <td>XEP-0324</td>
  186. <td>Defines how provisioning, the management of access privileges, etc., can be efficiently and easily implemented.</td>
  187. </tr>
  188. <tr>
  189. <td>XEP-0325</td>
  190. <td>Defines how to control actuators and other devices in Internet of Things.</td>
  191. </tr>
  192. <tr>
  193. <td>XEP-0326</td>
  194. <td>Defines how to handle architectures containing concentrators or servers handling multiple Things.</td>
  195. </tr>
  196. <tr>
  197. <td>XEP-0331</td>
  198. <td>Defines extensions for how color parameters can be handled, based on &xep0004;</td>
  199. </tr>
  200. <tr>
  201. <td>XEP-0336</td>
  202. <td>Defines extensions for how dynamic forms can be created, based on &xep0004;, &xep0122;, &xep0137; and &xep0141;.</td>
  203. </tr>
  204. <tr>
  205. <td>XEP-0347</td>
  206. <td>This specification. Defines the peculiars of Thing discovery in Internet of Things. Apart from discovering Things by JID, it also defines how to discover Things based on location, etc.</td>
  207. </tr>
  208. </table>
  209. </section1>
  210. <section1 topic='Glossary' anchor='glossary'>
  211. <p>The following table lists common terms and corresponding descriptions.</p>
  212. <dl>
  213. <di>
  214. <dt>Actuator</dt>
  215. <dd>Device containing at least one configurable property or output that can and should be controlled by some other entity or device.</dd>
  216. </di>
  217. <di>
  218. <dt>Authority</dt>
  219. <dd>Used synonymously with Provisioning Server.</dd>
  220. </di>
  221. <di>
  222. <dt>Computed Value</dt>
  223. <dd>A value that is computed instead of measured.</dd>
  224. </di>
  225. <di>
  226. <dt>Concentrator</dt>
  227. <dd>Device managing a set of devices which it publishes on the XMPP network.</dd>
  228. </di>
  229. <di>
  230. <dt>Field</dt>
  231. <dd>
  232. One item of sensor data. Contains information about: Node, Field Name, Value, Precision, Unit, Value Type, Status, Timestamp, Localization information, etc.
  233. Fields should be unique within the triple (Node ID, Field Name, Timestamp).
  234. </dd>
  235. </di>
  236. <di>
  237. <dt>Field Name</dt>
  238. <dd>Name of a field of sensor data. Examples: Energy, Volume, Flow, Power, etc.</dd>
  239. </di>
  240. <di>
  241. <dt>Field Type</dt>
  242. <dd>What type of value the field represents. Examples: Momentary Value, Status Value, Identification Value, Calculated Value, Peak Value, Historical Value, etc.</dd>
  243. </di>
  244. <di>
  245. <dt>Historical Value</dt>
  246. <dd>A value stored in memory from a previous timestamp.</dd>
  247. </di>
  248. <di>
  249. <dt>Identification Value</dt>
  250. <dd>A value that can be used for identification. (Serial numbers, meter IDs, locations, names, etc.)</dd>
  251. </di>
  252. <di>
  253. <dt>Localization information</dt>
  254. <dd>Optional information for a field, allowing the sensor to control how the information should be presented to human viewers.</dd>
  255. </di>
  256. <di>
  257. <dt>Meter</dt>
  258. <dd>A device possible containing multiple sensors, used in metering applications. Examples: Electricity meter, Water Meter, Heat Meter, Cooling Meter, etc.</dd>
  259. </di>
  260. <di>
  261. <dt>Momentary Value</dt>
  262. <dd>A momentary value represents a value measured at the time of the read-out.</dd>
  263. </di>
  264. <di>
  265. <dt>Node</dt>
  266. <dd>
  267. Graphs contain nodes and edges between nodes. In Internet of Things, sensors, actuators, meters, devices, gateways, etc., are often depicted as nodes whereas links between sensors (friendships)
  268. are depicted as edges. In abstract terms, it's easier to talk about a Node, rather than list different possible node types (sensors, actuators, meters, devices, gateways, etc.).
  269. Each Node has a Node ID.
  270. </dd>
  271. </di>
  272. <di>
  273. <dt>Node ID</dt>
  274. <dd>
  275. An ID uniquely identifying a node within its corresponding context. If a globally unique ID is desired, an architecture should be used using a universally accepted
  276. ID scheme.
  277. </dd>
  278. </di>
  279. <di>
  280. <dt>Parameter</dt>
  281. <dd>
  282. Readable and/or writable property on a node/device. The XEP-0326 &xep0326; deals with reading and writing parameters
  283. on nodes/devices. Fields are not parameters, and parameters are not fields.
  284. </dd>
  285. </di>
  286. <di>
  287. <dt>Peak Value</dt>
  288. <dd>A maximum or minimum value during a given period.</dd>
  289. </di>
  290. <di>
  291. <dt>Provisioning Server</dt>
  292. <dd>
  293. An application that can configure a network and provide services to users or Things. In Internet of Things, a Provisioning Server knows who knows whom,
  294. what privileges users have, who can read what data and who can control what devices and what parts of these devices.
  295. </dd>
  296. </di>
  297. <di>
  298. <dt>Precision</dt>
  299. <dd>
  300. In physics, precision determines the number of digits of precision. In sensor networks however, this definition is not easily applicable. Instead, precision
  301. determines, for example, the number of decimals of precision, or power of precision. Example: 123.200 MWh contains 3 decimals of precision. All entities parsing and
  302. delivering field information in sensor networks should always retain the number of decimals in a message.
  303. </dd>
  304. </di>
  305. <di>
  306. <dt>Sensor</dt>
  307. <dd>
  308. Device measuring at least one digital value (0 or 1) or analog value (value with precision and physical unit). Examples: Temperature sensor, pressure sensor, etc.
  309. Sensor values are reported as fields during read-out. Each sensor has a unique Node ID.
  310. </dd>
  311. </di>
  312. <di>
  313. <dt>SN</dt>
  314. <dd>Sensor Network. A network consisting, but not limited to sensors, where transport and use of sensor data is of primary concern. A sensor network may contain actuators, network applications, monitors, services, etc.</dd>
  315. </di>
  316. <di>
  317. <dt>Status Value</dt>
  318. <dd>A value displaying status information about something.</dd>
  319. </di>
  320. <di>
  321. <dt>Timestamp</dt>
  322. <dd>Timestamp of value, when the value was sampled or recorded.</dd>
  323. </di>
  324. <di>
  325. <dt>Thing</dt>
  326. <dd>
  327. Internet of Things basically consists of Things connected to the Internet. Things can be any device, sensor, actuator etc., that can have an
  328. Internet connection.
  329. </dd>
  330. </di>
  331. <di>
  332. <dt>Thing Registry</dt>
  333. <dd>
  334. A registry where Things can register for simple and secure discovery by the owner of the Thing. The registry can also be used as a database for meta information
  335. about Things in the network.
  336. </dd>
  337. </di>
  338. <di>
  339. <dt>Token</dt>
  340. <dd>
  341. A client, device or user can get a token from a provisioning server. These tokens can be included in requests to other entities in the network, so these entities can validate
  342. access rights with the provisioning server.
  343. </dd>
  344. </di>
  345. <di>
  346. <dt>Unit</dt>
  347. <dd>Physical unit of value. Example: MWh, l/s, etc.</dd>
  348. </di>
  349. <di>
  350. <dt>Value</dt>
  351. <dd>A field value.</dd>
  352. </di>
  353. <di>
  354. <dt>Value Status</dt>
  355. <dd>Status of field value. Contains important status information for Quality of Service purposes. Examples: Ok, Error, Warning, Time Shifted, Missing, Signed, etc.</dd>
  356. </di>
  357. <di>
  358. <dt>Value Type</dt>
  359. <dd>Can be numeric, string, boolean, Date &amp; Time, Time Span or Enumeration.</dd>
  360. </di>
  361. <di>
  362. <dt>WSN</dt>
  363. <dd>Wireless Sensor Network, a sensor network including wireless devices.</dd>
  364. </di>
  365. <di>
  366. <dt>XMPP Client</dt>
  367. <dd>Application connected to an XMPP network, having a JID. Note that sensors, as well as applications requesting sensor data can be XMPP clients.</dd>
  368. </di>
  369. </dl>
  370. </section1>
  371. <section1 topic='Use Cases' anchor='usecases'>
  372. <p>
  373. The life cycle of a Thing can be divided into multiple steps. The following sections will list many of these steps in possible order of occurrence during the
  374. life cycle of the Thing.
  375. </p>
  376. <section2 topic='Production' anchor='production'>
  377. <p>
  378. During production of a Thing, decisions have to be made whether the following parameters should be pre-configured, manually entered after installation or
  379. automatically found and/or created by the device if possible (zero-configuration networking):
  380. </p>
  381. <ul>
  382. <li>
  383. Address and domain of XMPP Server.
  384. </li>
  385. <li>
  386. JID of the Thing.
  387. </li>
  388. <li>
  389. JID of Thing Registry, if separate from the XMPP Server.
  390. </li>
  391. <li>
  392. JID of first Provisioning Server, if separate from Thing Registry or XMPP Server.
  393. </li>
  394. </ul>
  395. <p>
  396. A decision has to be made at this point if global/manufacturer/customer servers should be used, or if local resources should be searched for and used if found.
  397. The first option is easy to configure in a production environment and might have commercial significance,
  398. but cannot use local resources where available. The second leaves much responsibility to the Thing for finding local resources, but has the advantage of allowing for a more
  399. decentralized network architecture. A detailed discussion of the two alternatives goes beyond the scope of this specification, and will not be presented here.
  400. </p>
  401. </section2>
  402. <section2 topic='Installation' anchor='installation'>
  403. <p>
  404. Apart from physical installation, and connection to power and communication infrastructure, the installation phase of a Thing might also require manual entry of values that
  405. could not be set in the production environment. Since Things might have very limited human user interfaces, external tools might be required to provide this information. Due
  406. to its complexity, any manual entry of configuration parameters should be avoided, if possible. However, manual entry of some parameters might allow for Things to use local
  407. resources where such cannot be found nor set in a production environment.
  408. </p>
  409. </section2>
  410. <section2 topic='Finding XMPP Server' anchor='findingserver'>
  411. <p>
  412. If the address of an XMPP Server is not preconfigured, the Thing must attempt to find one in its local surroundings. This can be done using one of several methods:
  413. </p>
  414. <ul>
  415. <li>DHCP</li>
  416. <li>Multicast DNS</li>
  417. <li>SSDP/UPnP</li>
  418. </ul>
  419. <p>
  420. The following sections describe them in more detail.
  421. </p>
  422. <section3 topic='DHCP' anchor='dhcp'>
  423. <p>
  424. DHCP offers an internal structure for advertising configuration information to clients in a network.
  425. This includes configuration parameters and other control elements, which are transmitted in special marked data elements, called 'options', as described in
  426. <span class='ref'>
  427. <link url='http://tools.ietf.org/html/rfc3942'>RFC 3942</link>
  428. </span> <note>
  429. RFC 3942: Reclassifying Dynamic Host Configuration Protocol version 4 (DHCPv4) Options &lt;<link url='http://tools.ietf.org/html/rfc3942'>http://tools.ietf.org/html/rfc3942</link>&gt;.
  430. </note>.
  431. </p>
  432. <p>
  433. <link url='http://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.txt'>Dynamic Host Configuration Protocol (DHCP) and Bootstrap Protocol (BOOTP) Parameters</link> lists currently assigned 'options' by IANA.
  434. <strong>Note:</strong> There does exist no 'option' for XMPP at the moment.
  435. Options 224 to 254 are marked as 'site-specific option range' to support local (to a site) configuration options (i.e., reserved as 'Private Use').
  436. </p>
  437. <p>
  438. Possible codes for the XMPP server option:
  439. </p>
  440. <ul>
  441. <li>Use 'site-specific option range'. Use of 'option-code' 224.</li>
  442. <li>
  443. <strong>TBD:</strong> Define and register DHCP and BOOTP option as described in <link url='#option'>Parameters for IoT Discovery</link>. Use of 'option-code' 84.
  444. </li>
  445. </ul>
  446. <section4 topic='XMPP Server Option' anchor='serveroption'>
  447. <p>
  448. This option specifies the name of the XMPP server.
  449. The name may or may not be qualified with the local domain name.
  450. See &rfc1035; for character set restrictions.
  451. </p>
  452. <p>
  453. The code for this option is 224 (for 'site-specific option range') or 84 (for <link url='#option'>DHCP and BOOTP Parameters for IoT Discovery</link>), and its minimum length is 1.
  454. </p>
  455. <example caption='IoT Discovery DHCP Option'>
  456. <![CDATA[
  457. <option code> <data length> machine]]>
  458. </example>
  459. <p>So, for example, if the machine name is "pronto", the code for the option is 224, the XMPP server option would be as follows:</p>
  460. <example caption='IoT Discovery DHCP Option Example'>
  461. <![CDATA[
  462. 224 12 pronto.local]]>
  463. </example>
  464. </section4>
  465. <section4 topic='Dynamic Host Configuration Protocol (DHCP) and Bootstrap Protocol (BOOTP) Parameters for IoT Discovery' anchor='dhcpoption'>
  466. <p>The following parameters in use as of MONTH 201x. Refer to the DHCP and BOOTP parameters itself for a complete and current list of parameters (this specification might or might not be revised when new parameters are registered).</p>
  467. <example caption='IoT Discovery DHCP and BOOTP Parameters Registry'>
  468. <![CDATA[
  469. <tag>84</tag>
  470. <name>XMPP server</name>
  471. <data length>N</data length>
  472. <meaning>XMPP Servers DHCP Option</meaning>
  473. <reference>[RFC6120]</reference>]]>
  474. </example>
  475. </section4>
  476. </section3>
  477. <section3 topic='Multicast DNS (mDNS) and DNS Service Discovery (DNS-SD)' anchor='dns'>
  478. <p>
  479. An introduction of mDNS/DNS-SD (e.g., how it works and terminology) is described in &xep0174; (i.e., sections [1.2] and [2]).
  480. For the purpose of IoT Discovery we are interested only in the "xmpp-client" service.
  481. An XMPP server MUST publish four different kinds of DNS records to advertise its availability using the services of type "xmpp-client".
  482. An XMPP chat client (actually its mDNS daemon) can send out multicast DNS queries for services of type "xmpp-client".
  483. <strong>Note:</strong> the service of type "xmpp-client" is the reservered name for client-to-server connections by IANA, as described in &rfc6120;.
  484. </p>
  485. <section4 topic='DNS Records' anchor='dnsrecords'>
  486. <p>In order to advertise its availability, a server MUST publish four different kinds of DNS records:</p>
  487. <ol>
  488. <li>
  489. <p>A PTR record of the following form:</p>
  490. <example caption='PTR record'>
  491. <![CDATA[
  492. _xmpp-client._tcp.local. PTR machine._xmpp-client._tcp.local.]]>
  493. </example>
  494. </li>
  495. <li>
  496. <p>An address ("A" or "AAAA") record of the following form (where the IP address can be either an IPv4 address or an IPv6 address):</p>
  497. <example caption='A record'>
  498. <![CDATA[
  499. machine.local. A ip-address]]>
  500. </example>
  501. </li>
  502. <li>
  503. <p>A SRV record of the following form:</p>
  504. <example caption='SRV record'>
  505. <![CDATA[
  506. machine._xmpp-client._tcp.local <ttl> SRV <priority> <weight> port-number machine.local.]]>
  507. </example>
  508. </li>
  509. <li>
  510. <p>
  511. A TXT record whose name is the same as the SRV record and whose value follows the format described in the <link url='#txt'>TXT Record</link> section of this document, consisting of a set of strings that typically represent a series of key-value pairs such as the following:
  512. </p>
  513. <example caption='TXT record'>
  514. <![CDATA[
  515. txtvers=1
  516. ordom=example.com
  517. regis=registry
  518. provis=provisioning]]>
  519. </example>
  520. <p>Note: The DNS-SD specification stipulates that the TXT record MUST be published, but that it MAY contain no more than a single zero byte (e.g., if the server does not wish to publish any personal information).</p>
  521. </li>
  522. </ol>
  523. <p>
  524. For the purpose of IoT Discovery we are interested only in the "xmpp-client" service.
  525. An XMPP server MUST publish four different kinds of DNS records to advertise its availability using the services of type "xmpp-client".
  526. An XMPP chat client (actually its mDNS daemon) can send out multicast DNS queries for services of type "xmpp-client".
  527. <strong>Note:</strong> the service of type "xmpp-client" is the reservered name for client-to-server connections by IANA, as described in &rfc6120;.
  528. </p>
  529. <p>So, for example, if the machine name is "pronto", the IP address is "10.2.1.188", and the personal information, the DNS records would be as follows:</p>
  530. <example caption='IoT Discovery DNS Records Example'>
  531. <![CDATA[
  532. _xmpp-client._tcp.local. PTR pronto._xmpp-client._tcp.local.
  533. pronto._xmpp-client._tcp.local. SRV 5222 pronto.local.
  534. pronto.local. A 10.2.1.188
  535. pronto._xmpp-client._tcp.local. IN TXT
  536. "txtvers=1"
  537. "ordom=example.com"
  538. "regis=registry"
  539. "provis=provisioning"]]>
  540. </example>
  541. <p>The IPv4 and IPv6 addresses associated with a machine might vary depending on the local network to which the machine is connected. For example, on an Ethernet connection the physical address might be "192.168.0.100" but when the machine is connected to a wireless network the physical address might change to "10.10.1.188". See &rfc3927; for details.</p>
  542. <p>If the machine name asserted by a client is already taken by another machine on the network, the client MUST assert a different machine name, which SHOULD be formed by adding the character "-" and digit "1" to the end of the machine name string (e.g., "pronto-1"), adding the character "-" and digit "2" if the resulting machine name is already taken (e.g., "pronto-2"), and similarly incrementing the digit until a unique machine name is constructed.</p>
  543. <p>
  544. <strong>Note:</strong> DNS-SD enables service definitions to include a TXT record that specifies parameters to be used in the context of the relevant service type. For detailed information refer to &xep0174; (Link-Local Messaging - TXT Record).
  545. </p>
  546. </section4>
  547. <section4 topic='IoT Discovery TXT Record Parameters Registry' anchor='txt'>
  548. <p>The registration process is described in &xep0174; (Link-Local Messaging - Registration Process).</p>
  549. <p>The following submission registers parameters in use as of MONTH 201x. Refer to the registry itself for a complete and current list of parameters (this specification might or might not be revised when new parameters are registered).</p>
  550. <example caption='IoT Discovery TXT Record Parameters Registry'>
  551. <![CDATA[
  552. <param>
  553. <name>ordom</name>
  554. <desc>The "origin domain" of the XMPP service.</desc>
  555. <status>recommended</status>
  556. </param>
  557. <param>
  558. <name>regis</name>
  559. <desc>
  560. The username portion of the JID to Thing Registry;
  561. can contain a space-separated list of more than one JID.
  562. </desc>
  563. <status>optional</status>
  564. </param>
  565. <param>
  566. <name>provis</name>
  567. <desc>
  568. The username portion of the JID to provisioning server;
  569. can contain a space-separated list of more than one JID.
  570. </desc>
  571. <status>optional</status>
  572. </param>]]>
  573. </example>
  574. </section4>
  575. <!-- Ref: XEP-0174 -->
  576. </section3>
  577. <section3 topic='SSDP/UPnP' anchor='upnp'>
  578. <p>TBD</p>
  579. <!-- TODO -->
  580. </section3>
  581. <p>
  582. <strong>Note:</strong> If server-less messaging is to be used, as described in &xep0174; this step can be used to find the Thing Registry and optionally the
  583. Provisioning Server and other peers it want to connect to. The next section can thus be skipped.
  584. </p>
  585. </section2>
  586. <section2 topic='Connection to XMPP Server' anchor='connection'>
  587. <p>
  588. Once an XMPP Server has been found, a connection can be made. If multiple XMPP Servers are found, the client is free to choose the one that best suits its purposes.
  589. </p>
  590. <p>
  591. If the Thing does not have an account already, an account can be registered along what is specified in &xep0077;. If multiple servers are available, the first XMPP server that
  592. allows account creation can be used.
  593. </p>
  594. </section2>
  595. <section2 topic='Finding Thing Registry' anchor='findingregistry'>
  596. <p>
  597. If a Thing Registry is not preconfigured, one must be found. A Thing Registry can be hosted either as a server component using &xep0114; or as an XMPP Client accessible through
  598. a JID. The following lists methods to obtaining the Component Address or JID for the Thing Registry. Note that the last one has <link url='#security'>security considerations</link>
  599. that need to be taken into account, if implemented.
  600. </p>
  601. <ol>
  602. <li>
  603. Preconfigured Component Address of Thing Registry. A Component address is normally a subdomain to the domain of the XMPP Server that hosts the component.
  604. </li>
  605. <li>
  606. Preconfigured bare JID of Thing Registry.
  607. </li>
  608. <li>
  609. Preconfigured subdomain part of Component Address. This will be added to the domain of the XMPP Server used to connet to.
  610. </li>
  611. <li>
  612. Preconfigured user name of JID. This will be added to the domain of the XMPP Server used to connected to.
  613. </li>
  614. <li>
  615. Searching through Server Components on the XMPP Server currently connected to, as described in <link url='#support'>Determining Support</link>.
  616. </li>
  617. </ol>
  618. </section2>
  619. <section2 topic='Registering Thing' anchor='register'>
  620. <p>
  621. Once a Thing Registry has been found and been befriended, the Thing can register itself with the registry, as follows:
  622. </p>
  623. <example caption='Register Thing'>
  624. <![CDATA[
  625. <iq type='set'
  626. from='thing@example.org/imc'
  627. to='discovery.example.org'
  628. id='1'>
  629. <register xmlns='urn:xmpp:iot:discovery'>
  630. <str name='SN' value='394872348732948723'/>
  631. <str name='MAN' value='www.ktc.se'/>
  632. <str name='MODEL' value='IMC'/>
  633. <num name='V' value='1.2'/>
  634. <str name='KEY' value='4857402340298342'/>
  635. </register>
  636. </iq>
  637. <iq type='result'
  638. from='discovery.example.org'
  639. to='thing@example.org/imc'
  640. id='1'/>]]>
  641. </example>
  642. <p>
  643. There are two types of tags: Tags with string values and tags with numerical values. The distinction is important, since the type of value affects how
  644. comparisons are made later when performing searches in the registry.
  645. </p>
  646. <p>
  647. The Thing should only register parameters required to be known by the owner of the Thing. Dynamic meta information must be avoided at this point.
  648. To claim the ownership of the Thing, the owner needs to present the same meta information as registered by the Thing. Before an owner has claimed
  649. ownership of the Thing, it will not be returned in any search results. A list of predefined meta tag names can be found in the <link url='#tags'>Meta Tags</link>
  650. section below.
  651. </p>
  652. <p>
  653. The Thing can register itself as many times as it wants, and the response is always empty. Only one record per resource-less JID must be created. A new
  654. registration overrides any previous information, including meta tags previously reported but not available in the new registration. Once a Thing has been
  655. claimed by an owner, it should not register itself again, unless it is reset and the installation process restarted.
  656. </p>
  657. <p>
  658. If the Thing tries to register itself even though the Thing has already been claimed in the registry, the registry must not update any meta data in the registry, and instead
  659. respond with the following response. When the thing receives this, it can safely extract the JID of the owner and switch its internal state to claimed.
  660. </p>
  661. <example caption='Registration response when alrady claimed'>
  662. <![CDATA[
  663. <iq type='result'
  664. from='discovery.example.org'
  665. to='thing@example.org/imc'
  666. id='1'>
  667. <claimed xmlns='urn:xmpp:iot:discovery' jid='owner@example.org'/>
  668. </iq>]]>
  669. </example>
  670. <p>
  671. <strong>Note:</strong> Meta Tag names are case insensitive. In this document, all tag names have been written using upper case letters.
  672. </p>
  673. </section2>
  674. <section2 topic='Register self-owned Thing' anchor='registerselfowner'>
  675. <p>
  676. If a thing is self-owned, it can register itself with the Registry as normal, with the addition of setting the attribute <strong>selfOwned</strong> to <strong>true</strong>,
  677. as is shown below. This registers the Thing directly as PUBLIC CLAIMED, with no need for an owner to claim ownership of the device. This can be useful if
  678. installing Things that should be publically available.
  679. </p>
  680. <example caption='Register self-owned Thing'>
  681. <![CDATA[
  682. <iq type='set'
  683. from='thing@example.org/imc'
  684. to='discovery.example.org'
  685. id='2'>
  686. <register xmlns='urn:xmpp:iot:discovery' selfOwned='true'>
  687. <str name='SN' value='394872348732948723'/>
  688. <str name='MAN' value='www.ktc.se'/>
  689. <str name='MODEL' value='IMC'/>
  690. <num name='V' value='1.2'/>
  691. <str name='KEY' value='4857402340298342'/>
  692. </register>
  693. </iq>
  694. <iq type='result'
  695. from='discovery.example.org'
  696. to='thing@example.org/imc'
  697. id='2'/>]]>
  698. </example>
  699. </section2>
  700. <section2 topic='Register Thing behind Concentrator' anchor='registerconcentrator'>
  701. <p>
  702. A Thing might reside behind a gateway or concentrator and might not be directly connected to the XMPP network itself, as is described in &xep0326;. In these cases, there are three optional
  703. attributes that can be used to identify the Thing behind the JID: The <strong>nodeId</strong> attribute gives the ID of the Thing (a.k.a. "Node"). The Node might reside in
  704. specific Data Source (large systems might have multiple sources of nodes). In this case, the data source is specified in the <strong>sourceId</strong> attribute. Normally, the Node ID
  705. is considered to be unique within the concentrator. If multiple data sources are available, the Node ID is unique within the data source. However, a third attribute allows the uniqueness
  706. to be restricted to a given <strong>cacheType</strong>. Finally, it is the triple (<strong>nodeId</strong>, <strong>sourceId</strong>, <strong>cacheType</strong>) which guarantees
  707. uniqueness within the concentrator.
  708. </p>
  709. <p>
  710. For a Thing controlled by a concentrator to register itself in the Thing Registry, it simply adds the optional attributes <strong>nodeId</strong>, <strong>sourceId</strong>
  711. and <strong>cacheType</strong> as appropriate to the registration request, as follows:
  712. </p>
  713. <example caption='Register Thing behind Concentrator'>
  714. <![CDATA[
  715. <iq type='set'
  716. from='rack@example.org/plcs'
  717. to='discovery.example.org'
  718. id='3'>
  719. <register xmlns='urn:xmpp:iot:discovery' nodeId='imc1' sourceId='MeteringTopology'>
  720. <str name='SN' value='394872348732948723'/>
  721. <str name='MAN' value='www.ktc.se'/>
  722. <str name='MODEL' value='IMC'/>
  723. <num name='V' value='1.2'/>
  724. <str name='KEY' value='4857402340298342'/>
  725. </register>
  726. </iq>
  727. <iq type='result'
  728. from='discovery.example.org'
  729. to='rack@example.org/plcs'
  730. id='3'/>]]>
  731. </example>
  732. <p>
  733. If the Thing behind the concentrator is self-owned, it simply adds the <strong>selfOwned</strong> attribute to the request and sets it to <strong>true</strong>.
  734. </p>
  735. </section2>
  736. <section2 topic='Claiming Ownership of a Thing' anchor='claim'>
  737. <p>
  738. As mentioned above, the owner of the Thing must provide the information provided by the Thing to the Registry, in order to claim ownership over it. To avoid the
  739. possibility that somebody can guess the information, the information must necessarily be long. This creates the problem of transfer of information. One method to solve this
  740. is through the use of QR-codes. Such codes can be either printed on a sticker and put on the Thing itself, its wrapping, or displayed on its display when not claimed.
  741. This QR-code can then be photographed by a smart phone or tablet, decoded and the information retrieved can be used in the ownership claim call.
  742. </p>
  743. <p>
  744. If QR-codes are used to transfer Thing meta data for ownership claims, it must be generated as follows: To the string "IoTDisco" is appended all meta tags in order.
  745. Each tag name is prefixed by a semi-colon (;), and if the tag is numeric, the tag is prefixed by an additional hash sign (#). Each tag value is prefixed by a colon (:).
  746. If the meta value contains semi-colons or back-slashes, each one is prefixed by a back-slash. When decoding the string, this allows the decoder to correctly differ
  747. between tag delimiters and characters belonging to tag values. A tag name must never contain colon, hash sign or white space characters.
  748. </p>
  749. <p>
  750. The above meta data would therefore generate the string:
  751. </p>
  752. <example caption='String to encode as a QR-code'>
  753. <![CDATA[
  754. IoTDisco;SN:394872348732948723;MAN:www.ktc.se;MODEL:IMC;#V:1.2;KEY:4857402340298342]]>
  755. </example>
  756. <p>
  757. Using UTF-8 encoding when generating the QR-code, this string returns the following QR-code:
  758. </p>
  759. <p>
  760. <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAIAAAAiOjnJAAAABmJLR0QA/wD/AP+gvaeTAAAE9klEQVR4nO3d0WojORCG0WSZ93/l7MXeGAaDOqpPbXvPuQweuRN+NEVJLX3//Px8wbR/7n4APpNgkRAsEoJFQrBICBYJwSIhWCQEi4RgkRAsEoJFQrBICBYJwSIhWCQEi4RgkRAsEoJFQrBICBYJwSIhWCQEi8Sf2eG+v79nB/z6+nr2rvbjd+28z73yzI/jT33v1ed59gxTZn8XMxYJwSIhWCSGa6xHRd2zUlus1CgrP3825krNd3X8HXV9+TtmLBKCRUKwSIQ11qOrvaKVzzyOebW+eVYzXe1RTdVVU7XO1N95nxmLhGCRECwSh2qsKVPraDv109SYO32112fGIiFYJASLxJvVWDt9qZ3xV75r5TMrPbO71hxnmbFICBYJwSJxqMaaqg+uruVdrbem+kxX92xNrRW+Th1mxiIhWCQEi0RYY3X7qX/3DDs9pJ1xVmq1nT7cK/yd/2bGIiFYJASLxPfrdD4KV/dv7awV1mc6vBczFgnBIiFYJF7ofKyp85+u9o2e2fnM1F6rnRrx3lrQjEVCsEgIFonhPlZRG62MX5wRddfZp1Pfq8biAwkWCcEiEa4V3vWu3844z8Yszh3d6XVN7TN7Nv4+MxYJwSIhWCTeoI9V3HVT9HjqOuau/tnvmLFICBYJwSJx6C6dV1vnmtqzddUr71ebZcYiIVgkBIvEzX2suh9TP0/RW6r3Y51hxiIhWCQEi8TNfaydPUk7e5gKU+8M7uwDe/a99mPxIQSLhGCRuOEunZ2z1IuzD1YUPaGpM0uffWbl513dacYiIVgkBIvEDTXW1P/3V2udoqd19Yz4FVPvKt7LjEVCsEgIFolD+7GKu5avjl842SebeufxzFlZZiwSgkVCsEgc2o919fNTa2crzzNV30yd9VDXkWd6XWYsEoJFQrBIHLqv8GQf5eSe8al3GKfuw7nrzPq/mbFICBYJwSIRrhVO9XWK2mLle1cU57mvfJf3CvmfEiwSgkUiXCu82oMp9sLfdfb6zl3RxflY55mxSAgWCcEiccN9hSuf2elprTzPjrvu3ql7dfpYvAHBIiFYJA7VWI92+jfPxtl5hhU7+7GmnnNqT9uZ89/NWCQEi4RgkRheK9zZe1S/T1ecjzXVS5vq8917f84jMxYJwSIhWCRu3vN+sn8zpXgHsOg/ua+QDyRYJASLxKEaa6e/VZ8LX7yruKL43afOqthnxiIhWCQEi8Shu3RW/v+u+14r46w8T3EWw7Pxp9YWT96N/R8zFgnBIiFYJA7VWMWdfcW5VifPndp5/qv721bOyJhlxiIhWCQEi8Shc96nvMLZm1PrnvWZWPfuaTNjkRAsEoJFInyvcMrO/YBX38Xb+d6p/WcrdtZDrRXyxgSLhGCReKE7oR9NnUd1cv/WXeMXz7PPjEVCsEgIFokX2o9Vnyla9JmKs92n/q21Qj6QYJEQLBKHaqzCzruKO+uPO+epPvuu4l4ga4V8IMEiIVgk3rjGelScxbDymeLdvbrnd4YZi4RgkRAsEi90PtZVO+tfU2tkO+uPKzXZybO4ZpmxSAgWCcEiEdZYdR9lquaY2iN19X3DnX7VyX1gv2PGIiFYJASLxJudj8W7MGORECwSgkVCsEgIFgnBIiFYJASLhGCRECwSgkVCsEgIFgnBIiFYJASLhGCRECwSgkVCsEgIFgnBIiFYJASLhGCR+BeI2KOmeSzf/QAAAABJRU5ErkJggg=='/>
  761. </p>
  762. <p>
  763. Once the client has the required meta information about the Thing to claim ownership, it sends itself the following request to the Thing Registry:
  764. </p>
  765. <example caption='Claim Ownership of public Thing'>
  766. <![CDATA[
  767. <iq type='set'
  768. from='owner@example.org/phone'
  769. to='discovery.example.org'
  770. id='4'>
  771. <mine xmlns='urn:xmpp:iot:discovery'>
  772. <str name='SN' value='394872348732948723'/>
  773. <str name='MAN' value='www.ktc.se'/>
  774. <str name='MODEL' value='IMC'/>
  775. <num name='V' value='1.2'/>
  776. <str name='KEY' value='4857402340298342'/>
  777. </mine>
  778. </iq>]]>
  779. </example>
  780. <p>
  781. If this claim is successful, the Thing is marked as a public claimed Thing. The thing can always be removed later, but after the claim, the Thing is public. If you want to claim
  782. a private Thing, you can add the <strong>public</strong> attribute with value <strong>false</strong> to the claim, as follows:
  783. </p>
  784. <example caption='Claim Ownership of private Thing'>
  785. <![CDATA[
  786. <iq type='set'
  787. from='owner@example.org/phone'
  788. to='discovery.example.org'
  789. id='4'>
  790. <mine xmlns='urn:xmpp:iot:discovery' public='false'>
  791. <str name='SN' value='394872348732948723'/>
  792. <str name='MAN' value='www.ktc.se'/>
  793. <str name='MODEL' value='IMC'/>
  794. <num name='V' value='1.2'/>
  795. <str name='KEY' value='4857402340298342'/>
  796. </mine>
  797. </iq>]]>
  798. </example>
  799. <p>
  800. In this case, if the claim is successful, the Thing will not be made public in the Thing Registry, after the claim.
  801. </p>
  802. <p>
  803. If a claim is successful, i.e. there's a Thing that has not been claimed with EXACTLY the same meta data (however, the order is not important), the Thing is marked in the
  804. Registry as CLAIMED, and as public or private depending on the <strong>public</strong> attribute, and an empty result is returned as follows. If there's a claimed Thing with
  805. exactly the same meta data, and the JID of the claimant (without resource) matches the JID of the claimer (without resource), a success response is also returned, containing
  806. the resource-less JID of the Thing, as follows:
  807. </p>
  808. <example caption='Ownership claim successful'>
  809. <![CDATA[
  810. <iq type='result'
  811. from='discovery.example.org'
  812. to='owner@example.org/phone'
  813. id='4'>
  814. <claimed xmlns='urn:xmpp:iot:discovery' jid='thing@example.org'/>
  815. </iq>]]>
  816. </example>
  817. <p>
  818. If the Thing that has been claimed resides behind a concentrator, the result will contain those of the attributes <strong>nodeId</strong>, <strong>sourceId</strong>
  819. and <strong>cacheType</strong> that are required to access the Thing in calls made using &xep0323;, &xep0324;, &xep0325; and &xep0326;. The following example illustrates
  820. a response where a Thing behind a Concentrator has been claimed:
  821. </p>
  822. <example caption='Ownership claim of a Thing behind a concentrator successful'>
  823. <![CDATA[
  824. <iq type='result'
  825. from='discovery.example.org'
  826. to='owner@example.org/phone'
  827. id='4'>
  828. <claimed xmlns='urn:xmpp:iot:discovery' jid='rack@example.org/plcs' nodeId='imc1' sourceId='MeteringTopology'/>
  829. </iq>]]>
  830. </example>
  831. <p>
  832. If, on the other hand, no such Thing was found, or if such a Thing was found, but it is already claimed by somebody else, a failure response is returned. This response
  833. should avoid to inform the client in detail why the claim failed, as follows:
  834. </p>
  835. <example caption='Ownership claim failure'>
  836. <![CDATA[
  837. <iq type='error'
  838. from='discovery.example.org'
  839. to='owner@example.org/phone'
  840. id='4'>
  841. <error type='cancel'>
  842. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  843. </error>
  844. </iq>]]>
  845. </example>
  846. <p>
  847. When the Thing has been successfully claimed, the Registry sends information about this to the Thing, to inform it that it has been claimed and the resource-less JID of owner.
  848. After receiving this information, it doesn't need to register itself with the Registry anymore.
  849. </p>
  850. <example caption='Ownership claimed'>
  851. <![CDATA[
  852. <iq type='set'
  853. from='discovery.example.org'
  854. to='thing@example.org/imc'
  855. id='5'>
  856. <claimed xmlns='urn:xmpp:iot:discovery' jid='owner@example.org'/>
  857. </iq>]]>
  858. </example>
  859. <p>
  860. If the Thing was claimed as a private Thing, this is shown using the <strong>public</strong> attribute in the response, as follows:
  861. </p>
  862. <example caption='Ownership claim of private Thing successful'>
  863. <![CDATA[
  864. <iq type='set'
  865. from='discovery.example.org'
  866. to='thing@example.org/imc'
  867. id='5'>
  868. <claimed xmlns='urn:xmpp:iot:discovery' jid='owner@example.org' public='false'/>
  869. </iq>]]>
  870. </example>
  871. <p>
  872. If the <strong>public</strong> attribute is present and has value <strong>false</strong>, it means no further meta data updates are necessary, since
  873. the device is not searchable through the Thing Registry.
  874. </p>
  875. <p>
  876. If the Thing resides behind a concentrator, the request must contain those of the attributes <strong>nodeId</strong>, <strong>sourceId</strong>
  877. and <strong>cacheType</strong> that are required to access the Thing, as follows:
  878. </p>
  879. <example caption='Ownership of Thing behind concentrator claimed'>
  880. <![CDATA[
  881. <iq type='set'
  882. from='discovery.example.org'
  883. to='rack@example.org/plcs'
  884. id='5'>
  885. <claimed xmlns='urn:xmpp:iot:discovery' jid='owner@example.org' nodeId='imc1' sourceId='MeteringTopology'/>
  886. </iq>]]>
  887. </example>
  888. <p>
  889. The Thing simply returns an empty response to acknowledge the receipt of the information, as follows:
  890. </p>
  891. <example caption='Ownership claimed acknowledged'>
  892. <![CDATA[
  893. <iq type='result'
  894. from='thing@example.org/imc'
  895. to='discovery.example.org'
  896. id='5'/>]]>
  897. </example>
  898. <p>
  899. After receiving this, the thing knows it can accept friendship requests from the corresponding owner. It can also safely send a friendship request to the owner.
  900. </p>
  901. <p>
  902. <strong>Note:</strong> Meta Tag names are case insensitive. In this document, all tag names have been written using upper case letters.
  903. </p>
  904. </section2>
  905. <section2 topic='Removing Thing from Registry' anchor='remove'>
  906. <p>
  907. After a Thing has been claimed and is registed as a PUBLIC CLAIMED Thing in the Registry, it implies the Thing is available in searches. The owner can choose to remove
  908. the Thing from the Registry, to avoid that the Thing appears in searches. To remove a Thing from the Registry the owner simply sends a removal request to the Registry
  909. with the resource-less JID of the Thing to remove, as follows:
  910. </p>
  911. <example caption='Remove Thing'>
  912. <![CDATA[
  913. <iq type='set'
  914. from='owner@example.org/phone'
  915. to='discovery.example.org'
  916. id='6'>
  917. <remove xmlns='urn:xmpp:iot:discovery' jid='thing@example.org'/>
  918. </iq>]]>
  919. </example>
  920. <p>
  921. If the Thing resides behind a concentrator, the request must contain those of the attributes <strong>nodeId</strong>, <strong>sourceId</strong>
  922. and <strong>cacheType</strong> that are required to access the Thing, as follows:
  923. </p>
  924. <example caption='Remove Thing behind concentrator'>
  925. <![CDATA[
  926. <iq type='set'
  927. from='owner@example.org/phone'
  928. to='discovery.example.org'
  929. id='6'>
  930. <remove xmlns='urn:xmpp:iot:discovery' jid='rack@example.org/plcs' nodeId='imc1' sourceId='MeteringTopology'/>
  931. </iq>]]>
  932. </example>
  933. <p>
  934. If such a Thing is found and is owned by the caller, it is removed from the Registry, and an empty response is returned, to acknowledge the removal of the Thing
  935. from the registry, as follows:
  936. </p>
  937. <example caption='Thing removed'>
  938. <![CDATA[
  939. <iq type='result'
  940. from='discovery.example.org'
  941. to='owner@example.org/phone'
  942. id='6'/>]]>
  943. </example>
  944. <p>
  945. However, if such a thing is not found, or if the thing is owned by another, an <strong>item-not-found</strong> error is returned, as follows:
  946. </p>
  947. <example caption='Removal failure'>
  948. <![CDATA[
  949. <iq type='error'
  950. from='discovery.example.org'
  951. to='owner@example.org/phone'
  952. id='6'>
  953. <error type='cancel'>
  954. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  955. </error>
  956. </iq>]]>
  957. </example>
  958. <p>
  959. After successfully removing a Thing from the Registry, and if the Thing is friend to the Registry, the Registry informs the Thing it has been removed from the Registry.
  960. It does this, so the Thing can remove the friendship and stop any meta data updates to the Registry.
  961. </p>
  962. <example caption='Thing removed from registry by owner'>
  963. <![CDATA[
  964. <iq type='set'
  965. from='discovery.example.org'
  966. to='thing@example.org/imc'
  967. id='7'>
  968. <removed xmlns='urn:xmpp:iot:discovery'/>
  969. </iq>
  970. <iq type='result'
  971. from='thing@example.org/imc'
  972. to='discovery.example.org'
  973. id='7'/>]]>
  974. </example>
  975. <p>
  976. If the Thing lies behind a concentrator, the removal request would look as follows:
  977. </p>
  978. <example caption='Thing behind concentrator removed from registry by owner'>
  979. <![CDATA[
  980. <iq type='set'
  981. from='discovery.example.org'
  982. to='rack@example.org/plcs'
  983. id='7'>
  984. <removed xmlns='urn:xmpp:iot:discovery' nodeId='imc1' sourceId='MeteringTopology'/>
  985. </iq>]]>
  986. </example>
  987. <p>
  988. The Thing acknowledges the removal request by returning an empty response, as follows:
  989. </p>
  990. <example caption='Removal acknowledgement'>
  991. <![CDATA[
  992. <iq type='result'
  993. from='thing@example.org/imc'
  994. to='discovery.example.org'
  995. id='7'/>]]>
  996. </example>
  997. </section2>
  998. <section2 topic='Finding Provisioning Server' anchor='findingprovisioning'>
  999. <p>
  1000. Up to this point only basic configuration and ownership and visibility of a Thing has been covered. For more advanced operations, a Thing might be required to
  1001. use a Provisioning Server to whom it can delegate trust and allow making decisions, controlling access rights and privileges for the Thing, as described in &xep0324;.
  1002. If a Provisioning Server is not preconfigured, one must be found. The following lists methods to obtaining the JID for the Provisioning Server.
  1003. </p>
  1004. <ol>
  1005. <li>
  1006. Preconfigured Component Address of Provisioning Server. A Component address is normally a subdomain to the domain of the XMPP Server that hosts the component.
  1007. </li>
  1008. <li>
  1009. Preconfigured bare JID of Provisioning Server.
  1010. </li>
  1011. <li>
  1012. Preconfigured subdomain part of Component Address. This will be added to the domain of the XMPP Server used to connet to.
  1013. </li>
  1014. <li>
  1015. Preconfigured user name of JID. This will be added to the domain of the XMPP Server used to connected to.
  1016. </li>
  1017. <li>
  1018. The Thing Registry itself can be a Provisioning Server. This can be found out by sending a discovery request to the Thing Registry,
  1019. as described in <link url='#support'>Determining Support</link>.
  1020. </li>
  1021. <li>
  1022. The Owner itself can be a Provisioning Server. This can be found out by sending a discovery request to the Owner,
  1023. as described in <link url='#support'>Determining Support</link>.
  1024. </li>
  1025. <li>
  1026. Searching through Server Components on the XMPP Server currently connected to, as described in <link url='#support'>Determining Support</link>.
  1027. </li>
  1028. </ol>
  1029. </section2>
  1030. <section2 topic='Delegating Trust' anchor='delegate'>
  1031. <p>
  1032. Once a Provisioning Server has been found and been befriended, the Thing can delegate its trust to it, according to &xep0324;.
  1033. </p>
  1034. </section2>
  1035. <section2 topic='Update Meta Information about Thing in Registry' anchor='update'>
  1036. <p>
  1037. Once a Thing has been claimed and chooses to reside as a public Thing in the registry, it can update its meta information at any time. This meta information
  1038. will be available in searches made to the registry by third parties and is considered public. However, the Thing should be connected to a provisioning server
  1039. at this point, so that correct decisions can be made regarding to friendship, readout and control requests made by parties other than the owner.
  1040. </p>
  1041. <p>
  1042. Meta information updated in this way will only overwrite tags provided in the request, and leave other tags previously reported as is. To remove a string-valued tag,
  1043. it should be updated with an empty value. It is also recommended that key meta information required to claim ownership of the Thing after a factory reset is
  1044. either removed, truncated or otherwise modified after it has been claimed so that third parties with physical access to a public Thing cannot hijack it by searching
  1045. for it, extracting its meta information from the registry, then resetting it and then claiming ownership of it.
  1046. </p>
  1047. <p>
  1048. To update meta data about itself, a Thing simply sends a request to the Thing Registry, as follows:
  1049. </p>
  1050. <example caption='Update Meta Data request'>
  1051. <![CDATA[
  1052. <iq type='set'
  1053. from='thing@example.org/imc'
  1054. to='discovery.example.org'
  1055. id='8'>
  1056. <update xmlns='urn:xmpp:iot:discovery'>
  1057. <str name='KEY' value=''/>
  1058. <str name='CLASS' value='PLC'/>
  1059. <num name='LON' value='-71.519722'/>
  1060. <num name='LAT' value='-33.008055'/>
  1061. </update>
  1062. </iq>]]>
  1063. </example>
  1064. <p>
  1065. If the Thing resides behind a concentrator, the request must contain those of the attributes <strong>nodeId</strong>, <strong>sourceId</strong>
  1066. and <strong>cacheType</strong> that are required to access the Thing, as follows:
  1067. </p>
  1068. <example caption='Update Meta Data of Thing behind concentrator'>
  1069. <![CDATA[
  1070. <iq type='set'
  1071. from='rack@example.org/plcs'
  1072. to='discovery.example.org'
  1073. id='8'>
  1074. <update xmlns='urn:xmpp:iot:discovery' nodeId='imc1' sourceId='MeteringTopology'>
  1075. <str name='KEY' value=''/>
  1076. <str name='CLASS' value='PLC'/>
  1077. <num name='LON' value='-71.519722'/>
  1078. <num name='LAT' value='-33.008055'/>
  1079. </update>
  1080. </iq>]]>
  1081. </example>
  1082. <p>
  1083. If the Thing is found in the registry and it is claimed, the registry simply acknowledges the update as follows:
  1084. </p>
  1085. <example caption='Update Meta Data request acknowledgement'>
  1086. <![CDATA[
  1087. <iq type='result'
  1088. from='discovery.example.org'
  1089. to='thing@example.org/imc'
  1090. id='8'/>]]>
  1091. </example>
  1092. <p>
  1093. However, if the Thing is not found in the registry, probably because the owner has removed it from the registry, an error response is returned. When receiving
  1094. such a response, the Thing should assume it is the owner who has removed it from the registry, and that further meta data updates are not desired. The Thing
  1095. can then unfriend the registry and stop further meta data updates. The error response from the registry would look as follows:
  1096. </p>
  1097. <example caption='Update Meta Data request failure'>
  1098. <![CDATA[
  1099. <iq type='error'
  1100. from='discovery.example.org'
  1101. to='thing@example.org/imc'
  1102. id='8'>
  1103. <error type='cancel'>
  1104. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1105. </error>
  1106. </iq>]]>
  1107. </example>
  1108. <p>
  1109. If the Thing on the other hand is found in the Registry, but is not claimed, the registry must not update any meta data in the registry, and instead
  1110. respond with the following response. When the thing receives this, the Thing can assume it has been disowned, and perform a new registration in the Registry so
  1111. that it can be re-claimed.
  1112. </p>
  1113. <example caption='Update Meta Data response to request from disowned Thing'>
  1114. <![CDATA[
  1115. <iq type='result'
  1116. from='discovery.example.org'
  1117. to='thing@example.org/imc'
  1118. id='8'>
  1119. <disowned xmlns='urn:xmpp:iot:discovery'/>
  1120. </iq>]]>
  1121. </example>
  1122. <p>
  1123. <strong>Note:</strong> Meta Tag names are case insensitive. In this document, all tag names have been written using upper case letters.
  1124. </p>
  1125. </section2>
  1126. <section2 topic='Owner updating Meta Information about Thing in Registry' anchor='ownerupdate'>
  1127. <p>
  1128. An owner of a thing can also update the meta-data of a thing it has claimed. To do this, you simply add a <strong>jid</strong> attribute containing the JID of the thing to the
  1129. <strong>update</strong> element. (If this attribute is not present, the JID is assumed to be that of the sender of the message.)
  1130. </p>
  1131. <example caption='Owner requests an update of Meta Data of Thing'>
  1132. <![CDATA[
  1133. <iq type='set'
  1134. from='owner@example.org/1234'
  1135. to='discovery.example.org'
  1136. id='8'>
  1137. <update xmlns='urn:xmpp:iot:discovery' jid='thing@example.org'>
  1138. <str name='ROOM' value='...'/>
  1139. <str name='APT' value='...'/>
  1140. <str name='BLD' value='...'/>
  1141. <str name='STREET' value='...'/>
  1142. <str name='STREETNR' value='...'/>
  1143. <str name='AREA' value='...'/>
  1144. <str name='CITY' value='...'/>
  1145. <str name='REGION' value='...'/>
  1146. <str name='COUNTRY' value='...'/>
  1147. </update>
  1148. </iq>]]>
  1149. </example>
  1150. <p>
  1151. The owner can update meta-data of things behind concentrators also. To do this, the corresponding attributes <strong>nodeId</strong>, <strong>sourceId</strong>
  1152. and <strong>cacheType</strong> must be used to identify the thing, as follows:
  1153. </p>
  1154. <example caption='Owner requests an update of Meta Data of Thing behind concentrator'>
  1155. <![CDATA[
  1156. <iq type='set'
  1157. from='owner@example.org/1234'
  1158. to='discovery.example.org'
  1159. id='8'>
  1160. <update xmlns='urn:xmpp:iot:discovery' jid='rack@example.org' nodeId='imc1' sourceId='MeteringTopology'>
  1161. <str name='ROOM' value='...'/>
  1162. <str name='APT' value='...'/>
  1163. <str name='BLD' value='...'/>
  1164. <str name='STREET' value='...'/>
  1165. <str name='STREETNR' value='...'/>
  1166. <str name='AREA' value='...'/>
  1167. <str name='CITY' value='...'/>
  1168. <str name='REGION' value='...'/>
  1169. <str name='COUNTRY' value='...'/>
  1170. </update>
  1171. </iq>]]>
  1172. </example>
  1173. <p>
  1174. If the Thing is found in the registry and it is claimed by the sender of the current message (i.e. owner is the sender), the registry simply acknowledges the update as follows:
  1175. </p>
  1176. <example caption='Owner updating thing Meta Data request acknowledgement'>
  1177. <![CDATA[
  1178. <iq type='result'
  1179. from='discovery.example.org'
  1180. to='owner@example.org/1234'
  1181. id='8'/>]]>
  1182. </example>
  1183. <p>
  1184. But if the owner is not the sender of the current message (i.e. owner is somebody else), or if the thing is not found at all, the server must report the node as
  1185. <strong>not existing</strong> (i.e. not existing among the set of things claimed by the owner).
  1186. </p>
  1187. <example caption='Owner updating thing Meta Data request failure'>
  1188. <![CDATA[
  1189. <iq type='error'
  1190. from='discovery.example.org'
  1191. to='owner@example.org/1234'
  1192. id='8'>
  1193. <error type='cancel'>
  1194. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1195. </error>
  1196. </iq>]]>
  1197. </example>
  1198. </section2>
  1199. <section2 topic='Search for Public Things in Registry' anchor='search'>
  1200. <p>
  1201. It is possible for anyone with access to the Thing Registry to search for public Things that have been claimed, including self-owned Things. Such searches
  1202. will never return things that have not been claimed or have been removed from the registry.
  1203. </p>
  1204. <p>
  1205. A search is performed by providing one or more comparison operators in a search request to the registry. If more than one comparison operator is provided, the
  1206. search is assumed to be performed on the intersection (i.e. AND) of all operators. If the union (i.e. OR) of different conditions is desired, multiple consecutive
  1207. searches have to be performed.
  1208. </p>
  1209. <p>
  1210. The following table lists available search operators, their element names and meanings:
  1211. </p>
  1212. <table caption='Search operators'>
  1213. <tr>
  1214. <th>Element</th>
  1215. <th>Type</th>
  1216. <th>Operator</th>
  1217. <th>Description</th>
  1218. </tr>
  1219. <tr>
  1220. <td>strEq</td>
  1221. <td>String</td>
  1222. <td>tag = c</td>
  1223. <td>Searches for string values tags with values equal to a provided constant value.</td>
  1224. </tr>
  1225. <tr>
  1226. <td>strNEq</td>
  1227. <td>String</td>
  1228. <td>tag &lt;&gt; c</td>
  1229. <td>Searches for string values tags with values not equal to a provided constant value.</td>
  1230. </tr>
  1231. <tr>
  1232. <td>strGt</td>
  1233. <td>String</td>
  1234. <td>tag &gt; c</td>
  1235. <td>Searches for string values tags with values greater than a provided constant value.</td>
  1236. </tr>
  1237. <tr>
  1238. <td>strGtEq</td>
  1239. <td>String</td>
  1240. <td>tag &gt;= c</td>
  1241. <td>Searches for string values tags with values greater than or equal to a provided constant value.</td>
  1242. </tr>
  1243. <tr>
  1244. <td>strLt</td>
  1245. <td>String</td>
  1246. <td>tag &lt; c</td>
  1247. <td>Searches for string values tags with values lesser than a provided constant value.</td>
  1248. </tr>
  1249. <tr>
  1250. <td>strLtEq</td>
  1251. <td>String</td>
  1252. <td>tag &lt;= c</td>
  1253. <td>Searches for string values tags with values lesser than or equal to a provided constant value.</td>
  1254. </tr>
  1255. <tr>
  1256. <td>strRange</td>
  1257. <td>String</td>
  1258. <td>min &lt;(=) tag &lt;(=) max</td>
  1259. <td>Searches for string values tags with values within a specified range of values. The endpoints can be included or excluded in the search.</td>
  1260. </tr>
  1261. <tr>
  1262. <td>strNRange</td>
  1263. <td>String</td>
  1264. <td>tag &lt;(=) min OR tag &gt;(=) max</td>
  1265. <td>Searches for string values tags with values outside of a specified range of values. The endpoints can be included or excluded in the range (and therefore correspondingly excluded or included in the search).</td>
  1266. </tr>
  1267. <tr>
  1268. <td>strMask</td>
  1269. <td>String</td>
  1270. <td>tag LIKE c</td>
  1271. <td>Searches for string values tags with values similar to a provided constant value including wildcards.</td>
  1272. </tr>
  1273. <tr>
  1274. <td>numEq</td>
  1275. <td>Numeric</td>
  1276. <td>tag = c</td>
  1277. <td>Searches for numerical values tags with values equal to a provided constant value.</td>
  1278. </tr>
  1279. <tr>
  1280. <td>numNEq</td>
  1281. <td>Numeric</td>
  1282. <td>tag &lt;&gt; c</td>
  1283. <td>Searches for numerical values tags with values not equal to a provided constant value.</td>
  1284. </tr>
  1285. <tr>
  1286. <td>numGt</td>
  1287. <td>Numeric</td>
  1288. <td>tag &gt; c</td>
  1289. <td>Searches for numerical values tags with values greater than a provided constant value.</td>
  1290. </tr>
  1291. <tr>
  1292. <td>numGtEq</td>
  1293. <td>Numeric</td>
  1294. <td>tag &gt;= c</td>
  1295. <td>Searches for numerical values tags with values greater than or equal to a provided constant value.</td>
  1296. </tr>
  1297. <tr>
  1298. <td>numLt</td>
  1299. <td>Numeric</td>
  1300. <td>tag &lt; c</td>
  1301. <td>Searches for numerical values tags with values lesser than a provided constant value.</td>
  1302. </tr>
  1303. <tr>
  1304. <td>numLtEq</td>
  1305. <td>Numeric</td>
  1306. <td>tag &lt;= c</td>
  1307. <td>Searches for numerical values tags with values lesser than or equal to a provided constant value.</td>
  1308. </tr>
  1309. <tr>
  1310. <td>numRange</td>
  1311. <td>Numeric</td>
  1312. <td>min &lt;(=) tag &lt;(=) max</td>
  1313. <td>Searches for numerical values tags with values within a specified range of values. The endpoints can be included or excluded in the search.</td>
  1314. </tr>
  1315. <tr>
  1316. <td>numNRange</td>
  1317. <td>Numeric</td>
  1318. <td>tag &lt;(=) min OR tag &gt;(=) max</td>
  1319. <td>Searches for numerical values tags with values outside of a specified range of values. The endpoints can be included or excluded in the range (and therefore correspondingly excluded or included in the search).</td>
  1320. </tr>
  1321. </table>
  1322. <p>
  1323. The following example shows how a search for specific devices within a specific geographic area can be found. More precisely, it searches for a certain kind of PLC
  1324. produced by a certain manufacturer, but only versions 1.0 &lt;= v &lt; 2.0 and with serial numbers beginning with 39487. The PLCs must also lie within latitude 33 ad 34
  1325. degrees south and between longitude 70 and 72 west.
  1326. </p>
  1327. <example caption='Searching for Things'>
  1328. <![CDATA[
  1329. <iq type='get'
  1330. from='curious@example.org/client'
  1331. to='discovery.example.org'
  1332. id='9'>
  1333. <search xmlns='urn:xmpp:iot:discovery' offset='0' maxCount='20'>
  1334. <strEq name='MAN' value='www.ktc.se'/>
  1335. <strEq name='MODEL' value='IMC'/>
  1336. <strMask name='SN' value='39487*' wildcard='*'/>
  1337. <numRange name='V' min='1' minIncluded='true' max='2' maxIncluded='false'/>
  1338. <numRange name='LON' min='-72' minIncluded='true' max='-70' maxIncluded='true'/>
  1339. <numRange name='LAT' min='-34' minIncluded='true' max='-33' maxIncluded='true'/>
  1340. </search>
  1341. </iq>]]>
  1342. </example>
  1343. <p>
  1344. The <strong>offset</strong> attribute tells the registry the number of responses to skip before returning found things. It provides a mechanism to page result sets
  1345. that are too large to return in one response. the <strong>maxCount</strong> attribute contains the desired maximum number of things to return in the response. The
  1346. registry can lower this value, if it decides the requested maximum number is too large.
  1347. </p>
  1348. <p>
  1349. If tag names are not found corresponding to the names provided in the search, the result set will always be empty. There's a reserved tag named <strong>KEY</strong>
  1350. that can be used to provide information shared only between things and their owners. If a search contains an operator referencing this tag name, the result set
  1351. must also always be empty. Searches on <strong>KEY</strong> MUST never find things. Furthermore, search results must never return <strong>KEY</strong> tags.
  1352. </p>
  1353. <p>
  1354. The registry returns any things found in a response similar to the following:
  1355. </p>
  1356. <example caption='Search result'>
  1357. <![CDATA[
  1358. <iq type='result'
  1359. from='discovery.example.org'
  1360. to='curious@example.org/client'
  1361. id='9'>
  1362. <found xmlns='urn:xmpp:iot:discovery' more='false'>
  1363. <thing owner='owner@example.org' jid='thing@example.org'>
  1364. <str name='SN' value='394872348732948723'/>
  1365. <str name='MAN' value='www.ktc.se'/>
  1366. <str name='MODEL' value='IMC'/>
  1367. <num name='V' value='1.2'/>
  1368. <str name='CLASS' value='PLC'/>
  1369. <num name='LON' value='-71.519722'/>
  1370. <num name='LAT' value='-33.008055'/>
  1371. </thing>
  1372. ...
  1373. </found>
  1374. </iq>]]>
  1375. </example>
  1376. <p>
  1377. If a Thing resides behind a concentrator, the response must contain those of the attributes <strong>nodeId</strong>, <strong>sourceId</strong>
  1378. and <strong>cacheType</strong> that are required to access the Thing, as follows:
  1379. </p>
  1380. <example caption='Search result containing Thing behind a concentrator'>
  1381. <![CDATA[
  1382. <iq type='result'
  1383. from='discovery.example.org'
  1384. to='curious@example.org/client'
  1385. id='9'>
  1386. <found xmlns='urn:xmpp:iot:discovery' more='false'>
  1387. <thing owner='owner@example.org' jid='rack@example.org' nodeId='imc1' sourceId='MeteringTopology'>
  1388. <str name='SN' value='394872348732948723'/>
  1389. <str name='MAN' value='www.ktc.se'/>
  1390. <str name='MODEL' value='IMC'/>
  1391. <num name='V' value='1.2'/>
  1392. <str name='CLASS' value='PLC'/>
  1393. <num name='LON' value='-71.519722'/>
  1394. <num name='LAT' value='-33.008055'/>
  1395. </thing>
  1396. ...
  1397. </found>
  1398. </iq>]]>
  1399. </example>
  1400. <p>
  1401. If more results are available in the search (accessible by using the <strong>offset</strong> attribute in a new search), the <strong>more</strong> attribute is
  1402. present with value <strong>true</strong>.
  1403. </p>
  1404. <p>
  1405. <strong>Note:</strong> Meta Tag names are case insensitive. In this document, all tag names have been written using upper case letters.
  1406. </p>
  1407. </section2>
  1408. <section2 topic='Unregistering Thing from Registry' anchor='unregister'>
  1409. <p>
  1410. A thing can unregister itself from the Registry. This can be done in an uninstallation procedure for instance. To unregister from the registry, it simply sends
  1411. an un-registration request to the registry as follows.
  1412. </p>
  1413. <example caption='Unregister Thing'>
  1414. <![CDATA[
  1415. <iq type='set'
  1416. from='thing@example.org/imc'
  1417. to='discovery.example.org'
  1418. id='10'>
  1419. <unregister xmlns='urn:xmpp:iot:discovery'/>
  1420. </iq>]]>
  1421. </example>
  1422. <p>
  1423. If the Thing resides behind a concentrator, the request must contain those of the attributes <strong>nodeId</strong>, <strong>sourceId</strong>
  1424. and <strong>cacheType</strong> that are required to access the Thing, as follows:
  1425. </p>
  1426. <example caption='Unregistring Thing behind concentrator'>
  1427. <![CDATA[
  1428. <iq type='set'
  1429. from='rack@example.org/plcs'
  1430. to='discovery.example.org'
  1431. id='10'>
  1432. <unregister xmlns='urn:xmpp:iot:discovery' nodeId='imc1' sourceId='MeteringTopology'/>
  1433. </iq>]]>
  1434. </example>
  1435. <p>
  1436. The registry always returns an empty response, simply to acknowledge the receipt of the request.
  1437. </p>
  1438. <example caption='Unregister Thing acknowledgement'>
  1439. <![CDATA[
  1440. <iq type='result'
  1441. from='discovery.example.org'
  1442. to='thing@example.org/imc'
  1443. id='10'/>]]>
  1444. </example>
  1445. </section2>
  1446. <section2 topic='Disowning Thing' anchor='disown'>
  1447. <p>
  1448. The owner of a Thing can disown the Thing, returning it to a state without owner. This is done by sending the following request to the Thing Registry:
  1449. </p>
  1450. <example caption='Disowning Thing'>
  1451. <![CDATA[
  1452. <iq type='set'
  1453. from='owner@example.org/phone'
  1454. to='discovery.example.org'
  1455. id='11'>
  1456. <disown xmlns='urn:xmpp:iot:discovery' jid='thing@example.org'/>
  1457. </iq>]]>
  1458. </example>
  1459. <p>
  1460. If the Thing resides behind a concentrator, the request must contain those of the attributes <strong>nodeId</strong>, <strong>sourceId</strong>
  1461. and <strong>cacheType</strong> that are required to access the Thing, as follows:
  1462. </p>
  1463. <example caption='Disowning Thing behind concentrator'>
  1464. <![CDATA[
  1465. <iq type='set'
  1466. from='owner@example.org/phone'
  1467. to='discovery.example.org'
  1468. id='11'>
  1469. <disown xmlns='urn:xmpp:iot:discovery' jid='rack@example.org/plcs' nodeId='imc1' sourceId='MeteringTopology'/>
  1470. </iq>]]>
  1471. </example>
  1472. <p>
  1473. If such a Thing is not found, or if the thing is not owned by the caller, an <strong>item-not-found</strong> error is returned, as follows:
  1474. </p>
  1475. <example caption='Failure to disown Thing - Not Found'>
  1476. <![CDATA[
  1477. <iq type='error'
  1478. from='discovery.example.org'
  1479. to='owner@example.org/phone'
  1480. id='11'>
  1481. <error type='cancel'>
  1482. <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1483. </error>
  1484. </iq>]]>
  1485. </example>
  1486. <p>
  1487. If such a Thing is found, and it is owned by the caller, but not online as a friend, the Thing cannot be disowned, since it would put the Thing in a state from which
  1488. it cannot be re-claimed. Therefore, the Thing Registry must respond in the following manner:
  1489. </p>
  1490. <example caption='Failure to disown Thing - Offline'>
  1491. <![CDATA[
  1492. <iq type='error'
  1493. from='discovery.example.org'
  1494. to='owner@example.org/phone'
  1495. id='11'>
  1496. <error type='cancel'>
  1497. <not-allowed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  1498. </error>
  1499. </iq>]]>
  1500. </example>
  1501. <p>
  1502. Before returning a response to the caller, the Thing Registry informs the Thing it has been disowned.
  1503. It does this, so the Thing can remove the friendship to the owner, and perform a new registration.
  1504. </p>
  1505. <example caption='Thing disowned in registry by owner'>
  1506. <![CDATA[
  1507. <iq type='set'
  1508. from='discovery.example.org'
  1509. to='thing@example.org/imc'
  1510. id='12'>
  1511. <disowned xmlns='urn:xmpp:iot:discovery'/>
  1512. </iq>]]>
  1513. </example>
  1514. <p>
  1515. If the Thing lies behind a concentrator, the disowned request would look as follows:
  1516. </p>
  1517. <example caption='Thing behind concentrator disowned in registry by owner'>
  1518. <![CDATA[
  1519. <iq type='set'
  1520. from='discovery.example.org'
  1521. to='rack@example.org/plcs'
  1522. id='12'>
  1523. <disowned xmlns='urn:xmpp:iot:discovery' nodeId='imc1' sourceId='MeteringTopology'/>
  1524. </iq>]]>
  1525. </example>
  1526. <p>
  1527. The Thing acknowledges that it has been disowned by returning an empty response, as follows:
  1528. </p>
  1529. <example caption='Acknowledging disownment'>
  1530. <![CDATA[
  1531. <iq type='result'
  1532. from='thing@example.org/imc'
  1533. to='discovery.example.org'
  1534. id='12'/>]]>
  1535. </example>
  1536. <p>
  1537. When receiving the acknowledgement from the Thing, the Thing is set as an unclaimed Thing in the Registry. Furthermore, all tags corresponding to the Thing are removed from the
  1538. registry, and a random KEY tag is added of sufficient complexity to make sure other clients cannot claim the Thing by guessing. Finally, an empty response is returned, to
  1539. acknowledge that the Thing has been disowned, as follows:
  1540. </p>
  1541. <example caption='Thing disowned'>
  1542. <![CDATA[
  1543. <iq type='result'
  1544. from='discovery.example.org'
  1545. to='owner@example.org/phone'
  1546. id='11'/>]]>
  1547. </example>
  1548. <p>
  1549. If for any reason, the Thing does not acknowledge the disowned request, or an error occurs, the Registry returns the same error as if the Thing would have been offline.
  1550. </p>
  1551. </section2>
  1552. </section1>
  1553. <section1 topic='Determining Support' anchor='support'>
  1554. <p>
  1555. If an entity is a Thing Registry and supports the protocol specified herein, it MUST advertise that fact by returning a feature of "urn:xmpp:iot:discovery" in response
  1556. to &xep0030; information requests.
  1557. </p>
  1558. <example caption="Service discovery information request">
  1559. <![CDATA[
  1560. <iq type='get'
  1561. from='device@example.org/device'
  1562. to='provisioning@example.org'
  1563. id='13'>
  1564. <query xmlns='http://jabber.org/protocol/disco#info'/>
  1565. </iq>]]>
  1566. </example>
  1567. <example caption="Service discovery information response">
  1568. <![CDATA[
  1569. <iq type='result'
  1570. from='provisioning@example.org'
  1571. to='device@example.org/device'
  1572. id='13'>
  1573. <query xmlns='http://jabber.org/protocol/disco#info'>
  1574. ...
  1575. <feature var='urn:xmpp:iot:discovery'/>
  1576. ...
  1577. </query>
  1578. </iq>]]>
  1579. </example>
  1580. <p>
  1581. To search for a Thing Registry hosted as a component on an XMPP Server, you first request a list of available components, as follows:
  1582. </p>
  1583. <example caption="Checking if server supports components">
  1584. <![CDATA[
  1585. <iq from='device@example.org/device' to='example.org' type='get' id='14'>
  1586. <query xmlns="http://jabber.org/protocol/disco#info"/>
  1587. </iq>]]>
  1588. </example>
  1589. <example caption="Response confirming support for components">
  1590. <![CDATA[
  1591. <iq type="result" id="14" from="example.org" to="device@example.org/device">
  1592. <query xmlns="http://jabber.org/protocol/disco#info">
  1593. ...
  1594. <feature var="http://jabber.org/protocol/disco#items"/>
  1595. ...
  1596. </query>
  1597. </iq>]]>
  1598. </example>
  1599. <p>
  1600. If components (items) are supported, a request for available components is made:
  1601. </p>
  1602. <example caption="Requesting list of server components">
  1603. <![CDATA[
  1604. <iq from='device@example.org/device' to='example.org' type='get' id='15'>
  1605. <query xmlns="http://jabber.org/protocol/disco#items"/>
  1606. </iq>]]>
  1607. </example>
  1608. <example caption="Response containing list of server components">
  1609. <![CDATA[
  1610. <iq type="result" id="15" from="example.org" to="995fab3dd759452ca9c370647323af0c@example.org/ebe2348e">
  1611. <query xmlns="http://jabber.org/protocol/disco#items">
  1612. ...
  1613. <item jid="discovery.example.org" name="Registro de cosas"/>
  1614. ...
  1615. </query>
  1616. </iq>]]>
  1617. </example>
  1618. <p>
  1619. The client then loops through all components (items) and checks what features they support, until a Thing Registry is found:
  1620. </p>
  1621. <example caption="Service discovery information request made to each component">
  1622. <![CDATA[
  1623. <iq type='get'
  1624. from='device@example.org/device'
  1625. to='discovery.example.org'
  1626. id='16'>
  1627. <query xmlns='http://jabber.org/protocol/disco#info'/>
  1628. </iq>]]>
  1629. </example>
  1630. <example caption="Service discovery information response from each component">
  1631. <![CDATA[
  1632. <iq type='result'
  1633. from='discovery.example.org'
  1634. to='device@example.org/device'
  1635. id='16'>
  1636. <query xmlns='http://jabber.org/protocol/disco#info'>
  1637. ...
  1638. <feature var='urn:xmpp:iot:discovery'/>
  1639. ...
  1640. </query>
  1641. </iq>]]>
  1642. </example>
  1643. </section1>
  1644. <section1 topic='Implementation Notes' anchor='impl'>
  1645. <section2 topic='JID vs Component Thing Registries' anchor='jidvscomponent'>
  1646. <p>
  1647. A client must treat the connection between a Thing Registry differently if it is hosted as a client, having a JID, or if it is hosted as a Jabber Server Component.
  1648. If it is hosted as a server component, there's no need for the thing to become friends with the Thing Registry. Messages and requests can be made directly to the
  1649. server component without having to add it to the roster or request presence subscriptions. If the Thing Registry is hosted as a client, having a JID (@ in the address),
  1650. the Thing Registry must be added to the roster of the client before the client can communicate with the Thing Registry.
  1651. </p>
  1652. </section2>
  1653. <section2 topic='Meta Tags' anchor='tags'>
  1654. <p>
  1655. This document does not limit the number or names of tags used by Things to register meta information about themselves. However, it provides some general limits and defines
  1656. the meaning of a few tags that must have the meanings specified herein.
  1657. </p>
  1658. <p>
  1659. The maximum length of a tag name is <strong>32</strong> characters. Tag names must not include colon (:), hash sign (#) or white space characters. String tag values
  1660. must not exceed 128 characters in length.
  1661. </p>
  1662. <p>
  1663. The following table lists predefined tag names and their corresponding meanings.
  1664. </p>
  1665. <table caption='Predefined tags'>
  1666. <tr>
  1667. <th>Tag Name</th>
  1668. <th>Type</th>
  1669. <th>Description</th>
  1670. </tr>
  1671. <tr>
  1672. <td>ALT</td>
  1673. <td>Numeric</td>
  1674. <td>Altitude (meters)</td>
  1675. </tr>
  1676. <tr>
  1677. <td>APT</td>
  1678. <td>String</td>
  1679. <td>Apartment associated with the Thing</td>
  1680. </tr>
  1681. <tr>
  1682. <td>AREA</td>
  1683. <td>String</td>
  1684. <td>Area associated with the Thing</td>
  1685. </tr>
  1686. <tr>
  1687. <td>BLD</td>
  1688. <td>String</td>
  1689. <td>Building associated with the Thing</td>
  1690. </tr>
  1691. <tr>
  1692. <td>CITY</td>
  1693. <td>String</td>
  1694. <td>City associated with the Thing</td>
  1695. </tr>
  1696. <tr>
  1697. <td>CLASS</td>
  1698. <td>String</td>
  1699. <td>Class of Thing</td>
  1700. </tr>
  1701. <tr>
  1702. <td>COUNTRY</td>
  1703. <td>String</td>
  1704. <td>Country associated with the Thing</td>
  1705. </tr>
  1706. <tr>
  1707. <td>KEY</td>
  1708. <td>String</td>
  1709. <td>Key, shared between thing and owner.</td>
  1710. </tr>
  1711. <tr>
  1712. <td>LAT</td>
  1713. <td>Numeric</td>
  1714. <td>Latitude (degrees)</td>
  1715. </tr>
  1716. <tr>
  1717. <td>LON</td>
  1718. <td>Numeric</td>
  1719. <td>Longitude (degrees)</td>
  1720. </tr>
  1721. <tr>
  1722. <td>MAN</td>
  1723. <td>String</td>
  1724. <td>Domain name owned by the Manufacturer</td>
  1725. </tr>
  1726. <tr>
  1727. <td>MLOC</td>
  1728. <td>String</td>
  1729. <td>Meter Location ID</td>
  1730. </tr>
  1731. <tr>
  1732. <td>MNR</td>
  1733. <td>String</td>
  1734. <td>Meter Number</td>
  1735. </tr>
  1736. <tr>
  1737. <td>MODEL</td>
  1738. <td>String</td>
  1739. <td>Name of Model</td>
  1740. </tr>
  1741. <tr>
  1742. <td>NAME</td>
  1743. <td>String</td>
  1744. <td>Name associated with the Thing</td>
  1745. </tr>
  1746. <tr>
  1747. <td>PURL</td>
  1748. <td>String</td>
  1749. <td>URL to product information for the Thing.</td>
  1750. </tr>
  1751. <tr>
  1752. <td>REGION</td>
  1753. <td>String</td>
  1754. <td>Region associated with the Thing</td>
  1755. </tr>
  1756. <tr>
  1757. <td>ROOM</td>
  1758. <td>String</td>
  1759. <td>Room associated with the Thing</td>
  1760. </tr>
  1761. <tr>
  1762. <td>SN</td>
  1763. <td>String</td>
  1764. <td>Serial Number</td>
  1765. </tr>
  1766. <tr>
  1767. <td>STREET</td>
  1768. <td>String</td>
  1769. <td>Street Name</td>
  1770. </tr>
  1771. <tr>
  1772. <td>STREETNR</td>
  1773. <td>String</td>
  1774. <td>Street Number</td>
  1775. </tr>
  1776. <tr>
  1777. <td>V</td>
  1778. <td>Numeric</td>
  1779. <td>Version Number</td>
  1780. </tr>
  1781. </table>
  1782. <p>
  1783. It is up to the Thing Registry to choose which tags it persists and which tags it doesn't. To avoid the possibility of malicious reporting of tags, some limit should be
  1784. imposed on what tags are supported. As a minimum, a Thing Registry must support all predefined tags, as listed above.
  1785. </p>
  1786. <p>
  1787. <strong>Note:</strong> Meta Tag names are case insensitive. In this document, all tag names have been written using upper case letters.
  1788. </p>
  1789. </section2>
  1790. <section2 topic='Friendships between Things and Registry' anchor='friendships'>
  1791. <p>
  1792. In the case the Thing Registry is not the XMPP Server to which the Thing is connected, a friendship relationship between the Thing and the Thing Registry needs to be handled.
  1793. To minimize the number of concurrent friends the Thing Registry needs to maintain, a Thing must only maintain an active friendship with the registry if it needs to
  1794. communicate with the registry. This means that unless updating meta data frequently, the Thing must unfriend the Registry when done with its communication. If only
  1795. updating meta data intermittently, the friendship can be reestablished when needed, and removed when done.
  1796. </p>
  1797. </section2>
  1798. </section1>
  1799. <section1 topic='Security Considerations' anchor='security'>
  1800. <section2 topic='Jabber Components Protocol' anchor='jcp'>
  1801. <p>
  1802. The &xep0114; provides an elegant way to introduce external services as server components using a third port into the server (the first two being the client-to-server port
  1803. and the server-to-server port). But since XEP-0114 is historical, meaning it is not guaranteed to conform to v1.0 of the XMPP specification, it has some serious security
  1804. issues:
  1805. </p>
  1806. <ol>
  1807. <li>It lacks SSL/TLS support, or the starttls element to switch to TLS after connecting. This makes it possible to sniff traffic in this port.</li>
  1808. <li>It lacks SASL authentication. Instead a simple handshake is performed</li>
  1809. <li>There is no way to actually verify that the server is the server. This makes it possible to create a simple Man-in-the-middle attack.</li>
  1810. </ol>
  1811. <p>
  1812. For these reasons, it is not recommended that a Thing Registry service, publishing itself as a Jabber Server Component, does so from outside of the network. Instead,
  1813. the Thing Registry should be installed on the same server or on a server in the same local area network, so that the Jabber Component protocol port is closed to the
  1814. Internet.
  1815. </p>
  1816. <p>
  1817. Since it is not guaranteed that an XMPP Server operator allows installation of third party products (such as a Thing Registry), the option to host a Thing Registry using
  1818. a normal JID is still available. It can be used in proof of concepts, etc. For scalability issues it is recommended that the Thing Registry be hosted as a Jabber Server
  1819. Component when the population of Things grows.
  1820. </p>
  1821. </section2>
  1822. <section2 topic='Hijacking predefined JIDs' anchor='hijackingjids'>
  1823. <p>
  1824. If using predefined user names when searching for a Thing Registry or Provisioning Server, care must be taken to which XMPP Server things connect.
  1825. It might be possible for third parties to register these predefined account names, and pretend to be a Thing Registry or Provisioning Server and in this way hijack
  1826. unsuspecting Things. If installing things using this method of finding a Thing Registry or Provisioning Server, these accounts must be registered beforehand, to make
  1827. sure the things cannot be hijacked.
  1828. </p>
  1829. </section2>
  1830. <section2 topic='Hijacking things in public areas' anchor='hijackingthings'>
  1831. <p>
  1832. The combination of visible key meta information (perhaps in a visible QR-code) and a factory default reset button on a Thing, opens up the possibility to hijack the Thing.
  1833. To avoid this, at least one of the two should be removed after successful installation. Either the key meta information (QR-code) should be placed on the package or separate
  1834. paper and not on the thing itself, or the factory default reset button should be sealed or hidden and only accessible by licensed maintenance personell. If using an electronic
  1835. means to present the key meta information (for instance by displayed a QR-code on a display on the thing), care should be taken so that the information cannot be displayed
  1836. without breaking a seal, or other means to protect the Thing.
  1837. </p>
  1838. <p>
  1839. Regardless the above security measures, a Thing can be hijacked by a third party in the time window between successful installation of the device and until the correct owner
  1840. has claimed ownership of the device. Minimizing this time window, and using a shared secret (KEY tag) between the Thing and its owner, decreases the possibility of getting the
  1841. thing hijacked.
  1842. </p>
  1843. </section2>
  1844. <section2 topic='Key meta information in searches' anchor='keysearch'>
  1845. <p>
  1846. Care should be taken what key meta information is used to accept an ownership claim. After a successful claim, this meta information is still available in the registry,
  1847. at least until the Thing is removed from the registry. While public in the registry, the meta information can be searched and presented to third parties. Access to this
  1848. information can help third parties to hijack Things, if they can reset them to factory default settings.
  1849. </p>
  1850. <p>
  1851. To avoid this, the Thing can do three things after a successful ownership claim:
  1852. </p>
  1853. <ul>
  1854. <li>
  1855. Including a <strong>KEY</strong> tag in the key meta information. The <strong>KEY</strong> tag is not searchable nor presented in search results.
  1856. </li>
  1857. <li>
  1858. Remove, truncate or change some key meta information after a successful ownership claim. Partial information is not sufficient for a successful ownership claim.
  1859. </li>
  1860. <li>
  1861. Remove the Thing from the registry.
  1862. </li>
  1863. </ul>
  1864. </section2>
  1865. <section2 topic='KEY tag' anchor='key'>
  1866. <p>
  1867. The <strong>KEY</strong> tag is unique in that it is not searchable nor available is search results. For this reason it is ideal for providing secrets shared only
  1868. between the Thing and the owner. By providing a sufficiently long KEY value in the key meta information required to claim the Thing, guessing the information even though
  1869. the other meta information is available, will be sufficiently hard to make it practically impossible.
  1870. </p>
  1871. <p>
  1872. Even though the <strong>KEY</strong> tag is not searchable or available in search results, it should be emptied by the Thing after a successful claim, just to make sure
  1873. the key cannot be learned by looking into the database of the registry, or by some other means.
  1874. </p>
  1875. </section2>
  1876. <section2 topic='Tag name spam' anchor='tagspam'>
  1877. <p>
  1878. This document does not limit tag names or the number of tags that can be used by Things. This opens up the possibility of tag spam. Malicious things could fill the database
  1879. of the registry by reporting random tag names until the database is full.
  1880. </p>
  1881. <p>
  1882. To prevent such malicious attacks, the registry could limit the tags it allows to be stored in the database. The registry must however allow the storage of the predefined
  1883. tag names defined in this document. If it has a configurable list of approved tags that can be stored, or if it allows any tags is an implementation decision.
  1884. </p>
  1885. </section2>
  1886. <section2 topic='External services for creating QR-codes' anchor='externalqr'>
  1887. <p>
  1888. If using external services when creating QR-codes, like the Google Charts API used in this document, make sure HTTPS is used and certificates validated. If HTTP is used,
  1889. meta-data tags used in Thing Registry registrations can be found out by sniffing the network, making it possible to hijack the corresponding devices.
  1890. </p>
  1891. </section2>
  1892. <section2 topic='DHCP Security Considerations' anchor='dhcpsec'>
  1893. <p>TBD</p>
  1894. <!-- TODO -->
  1895. </section2>
  1896. <section2 topic='DNS Security Considerations' anchor='dnssec'>
  1897. <p>TBD</p>
  1898. <!-- TODO -->
  1899. </section2>
  1900. <section2 topic='UPnP Security Considerations' anchor='upnpsec'>
  1901. <p>TBD</p>
  1902. <!-- TODO -->
  1903. </section2>
  1904. </section1>
  1905. <section1 topic='IANA Considerations' anchor='iana'>
  1906. <p>This document requires no interaction with &IANA;.</p>
  1907. </section1>
  1908. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  1909. <p>
  1910. The <link url="#schema">protocol schema</link> needs to be added to the list of <link url="http://xmpp.org/resources/schemas/">XMPP protocol schemas</link>.
  1911. </p>
  1912. </section1>
  1913. <section1 topic='XML Schema' anchor='schema'>
  1914. <code>
  1915. <![CDATA[
  1916. <?xml version='1.0' encoding='UTF-8'?>
  1917. <xs:schema
  1918. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  1919. targetNamespace='urn:xmpp:iot:discovery'
  1920. xmlns='urn:xmpp:iot:discovery'
  1921. elementFormDefault='qualified'>
  1922. <xs:element name='register' type='Register'/>
  1923. <xs:element name='mine' type='Mine'/>
  1924. <xs:element name='update' type='Update'/>
  1925. <xs:element name='claimed' type='Claimed'/>
  1926. <xs:element name='remove' type='Jid'/>
  1927. <xs:element name='removed' type='NodeInfo'/>
  1928. <xs:element name='unregister' type='NodeInfo'/>
  1929. <xs:element name='disown' type='Jid'/>
  1930. <xs:element name='disowned' type='NodeInfo'/>
  1931. <xs:element name='search'>
  1932. <xs:complexType>
  1933. <xs:choice minOccurs='1' maxOccurs='unbounded'>
  1934. <xs:element name='strEq' type='StrTag'/>
  1935. <xs:element name='strNEq' type='StrTag'/>
  1936. <xs:element name='strGt' type='StrTag'/>
  1937. <xs:element name='strGtEq' type='StrTag'/>
  1938. <xs:element name='strLt' type='StrTag'/>
  1939. <xs:element name='strLtEq' type='StrTag'/>
  1940. <xs:element name='strRange' type='StrRange'/>
  1941. <xs:element name='strNRange' type='StrRange'/>
  1942. <xs:element name='strMask'>
  1943. <xs:complexType>
  1944. <xs:attribute name='name' type='xs:string' use='required'/>
  1945. <xs:attribute name='value' type='xs:string' use='required'/>
  1946. <xs:attribute name='wildcard' type='xs:string' use='required'/>
  1947. </xs:complexType>
  1948. </xs:element>
  1949. <xs:element name='numEq' type='NumTag'/>
  1950. <xs:element name='numNEq' type='NumTag'/>
  1951. <xs:element name='numGt' type='NumTag'/>
  1952. <xs:element name='numGtEq' type='NumTag'/>
  1953. <xs:element name='numLt' type='NumTag'/>
  1954. <xs:element name='numLtEq' type='NumTag'/>
  1955. <xs:element name='numRange' type='NumRange'/>
  1956. <xs:element name='numNRange' type='NumRange'/>
  1957. </xs:choice>
  1958. <xs:attribute name='offset' type='xs:nonNegativeInteger' use='optional' default='0'/>
  1959. <xs:attribute name='maxCount' type='xs:positiveInteger' use='optional'/>
  1960. </xs:complexType>
  1961. </xs:element>
  1962. <xs:element name='found'>
  1963. <xs:complexType>
  1964. <xs:sequence minOccurs='0' maxOccurs='unbounded'>
  1965. <xs:element name='thing'>
  1966. <xs:complexType>
  1967. <xs:choice minOccurs='0' maxOccurs='unbounded'>
  1968. <xs:element name='str' type='StrTag'/>
  1969. <xs:element name='num' type='NumTag'/>
  1970. </xs:choice>
  1971. <xs:attribute name='owner' type='xs:string' use='required'/>
  1972. <xs:attribute name='jid' type='xs:string' use='required'/>
  1973. <xs:attributeGroup ref='nodeInfo'/>
  1974. </xs:complexType>
  1975. </xs:element>
  1976. </xs:sequence>
  1977. <xs:attribute name='more' type='xs:boolean' use='optional' default='false'/>
  1978. </xs:complexType>
  1979. </xs:element>
  1980. <xs:attributeGroup name='nodeInfo'>
  1981. <xs:attribute name='nodeId' type='xs:string' use='optional'/>
  1982. <xs:attribute name='sourceId' type='xs:string' use='optional'/>
  1983. <xs:attribute name='cacheType' type='xs:string' use='optional'/>
  1984. </xs:attributeGroup>
  1985. <xs:complexType name='MetaData'>
  1986. <xs:choice minOccurs='0' maxOccurs='unbounded'>
  1987. <xs:element name='str' type='StrTag'/>
  1988. <xs:element name='num' type='NumTag'/>
  1989. </xs:choice>
  1990. </xs:complexType>
  1991. <xs:complexType name='MetaDataNodeInfo'>
  1992. <xs:complexContent>
  1993. <xs:extension base='MetaData'>
  1994. <xs:attributeGroup ref='nodeInfo'/>
  1995. </xs:extension>
  1996. </xs:complexContent>
  1997. </xs:complexType>
  1998. <xs:complexType name='Register'>
  1999. <xs:complexContent>
  2000. <xs:extension base='MetaDataNodeInfo'>
  2001. <xs:attribute name='selfOwned' type='xs:boolean' use='optional' default='false'/>
  2002. </xs:extension>
  2003. </xs:complexContent>
  2004. </xs:complexType>
  2005. <xs:complexType name='Mine'>
  2006. <xs:complexContent>
  2007. <xs:extension base='MetaDataNodeInfo'>
  2008. <xs:attribute name='public' type='xs:boolean' use='optional' default='true'/>
  2009. </xs:extension>
  2010. </xs:complexContent>
  2011. </xs:complexType>
  2012. <xs:complexType name='Update'>
  2013. <xs:complexContent>
  2014. <xs:extension base='MetaDataNodeInfo'>
  2015. <xs:attribute name='jid' type='xs:string' use='optional'/>
  2016. </xs:extension>
  2017. </xs:complexContent>
  2018. </xs:complexType>
  2019. <xs:complexType name='Claimed'>
  2020. <xs:complexContent>
  2021. <xs:extension base='Jid'>
  2022. <xs:attribute name='public' type='xs:boolean' use='optional' default='false'/>
  2023. </xs:extension>
  2024. </xs:complexContent>
  2025. </xs:complexType>
  2026. <xs:complexType name='Jid'>
  2027. <xs:attribute name='jid' type='xs:string' use='required'/>
  2028. <xs:attributeGroup ref='nodeInfo'/>
  2029. </xs:complexType>
  2030. <xs:complexType name='NodeInfo'>
  2031. <xs:attributeGroup ref='nodeInfo'/>
  2032. </xs:complexType>
  2033. <xs:complexType name='StrTag'>
  2034. <xs:attribute name='name' type='xs:string' use='required'/>
  2035. <xs:attribute name='value' type='xs:string' use='required'/>
  2036. </xs:complexType>
  2037. <xs:complexType name='NumTag'>
  2038. <xs:attribute name='name' type='xs:string' use='required'/>
  2039. <xs:attribute name='value' type='xs:double' use='required'/>
  2040. </xs:complexType>
  2041. <xs:complexType name='StrRange'>
  2042. <xs:attribute name='name' type='xs:string' use='required'/>
  2043. <xs:attribute name='min' type='xs:string' use='required'/>
  2044. <xs:attribute name='minIncluded' type='xs:boolean' use='optional' default='true'/>
  2045. <xs:attribute name='max' type='xs:string' use='required'/>
  2046. <xs:attribute name='maxIncluded' type='xs:boolean' use='optional' default='true'/>
  2047. </xs:complexType>
  2048. <xs:complexType name='NumRange'>
  2049. <xs:attribute name='name' type='xs:string' use='required'/>
  2050. <xs:attribute name='min' type='xs:double' use='required'/>
  2051. <xs:attribute name='minIncluded' type='xs:boolean' use='optional' default='true'/>
  2052. <xs:attribute name='max' type='xs:double' use='required'/>
  2053. <xs:attribute name='maxIncluded' type='xs:boolean' use='optional' default='true'/>
  2054. </xs:complexType>
  2055. </xs:schema>]]>
  2056. </code>
  2057. </section1>
  2058. <section1 topic='For more information' anchor='moreinfo'>
  2059. <p>
  2060. For more information, please see the following resources:
  2061. </p>
  2062. <ul>
  2063. <li>
  2064. <p>
  2065. The <link url='http://wiki.xmpp.org/web/Tech_pages/SensorNetworks'>Sensor Network section of the XMPP Wiki</link> contains further information about the
  2066. use of the sensor network XEPs, links to implementations, discussions, etc.
  2067. </p>
  2068. </li>
  2069. <li>
  2070. <p>
  2071. The XEP's and related projects are also available on <link url='https://github.com/joachimlindborg/'>github</link>, thanks to Joachim Lindborg.
  2072. </p>
  2073. </li>
  2074. <li>
  2075. <p>
  2076. A presentation giving an overview of all extensions related to Internet of Things can be found here:
  2077. <link url='http://prezi.com/esosntqhewhs/iot-xmpp/'>http://prezi.com/esosntqhewhs/iot-xmpp/</link>.
  2078. </p>
  2079. </li>
  2080. </ul>
  2081. </section1>
  2082. <section1 topic='Acknowledgements' anchor='ack'>
  2083. <p>
  2084. Thanks to Eelco Cramer, Henrik Svedlund, Ivan Vučica, Joachim Lindborg, Joakim Eriksson, Joakim Ramberg, Johannes Hund, Karin Forsell, Kevin Smith, Lance Stout, Lars Åkerskog,
  2085. Olof Zandrén, Philipp Hancke, Steffen Larsen, Teemu Väisänen and Yusuke Doi for all valuable feedback.
  2086. </p>
  2087. </section1>
  2088. </xep>