Hi Peter and Eelco,
I've read your discussion about pubsub & XMPP IoT, here some hint fromme:
Perhaps it’s time to retake the XEP-writingeffort and
write down some guidelines for IoT on XMPP using pubsub…
I could be interested in working on this, if you start to write it, pleaseconsider to
include also me.
I have thought about implementing the second
ideaabove, myself. I think such a component might have a very important role forthe
publish/subscribe pattern in XMPP, and solves many of the security issuesin other pubsub
solutions. Would you be interested in investigating thisfurther?
Also in this case I would like to join, so if I can help, please contactme.
A third idea, based on the second idea above is thefollowing: Something that is missing
from the XMPP pubsub model, but isavailable in MQTT, is multi-layered publish/subscribe.
While implementing a newcontext-sensitive pubsub service, this might be something to add.
In MQTT youcan listen to a “parent node”, or wildcards, and receive events from all
its(grand*)child nodes for example. Example: Consider you publish a temperature onnode
building/floor/apartment/room/temp1. How would you do to listen to allsensors in that
room? Or all sensors in that apartment, floor or building? Orall temperature sensors in
that building (leaving out other kinds of sensors)?Using a wildcard character (*) you
could do this by subscribing to“building/floor/apartment/room/*”,
“building/floor/apartment/*”,“building/floor/*”, “building/*” and “building/*/*/*/temp*”
respectively in onego. That wo
uld provid
e a great way to subscribe to larger sets of contents,without having to maintain huge
amounts of smaller individual subscriptions.
About this idea...have youthought about the possibility to use collection nodes on the
server side, toimplement this? My suggestion for the subscriptions using wildcards is to
usethe collection nodes provided by the XEP-0060
(
http://xmpp.org/extensions/xep-0060.html). The idea is to create ahiearchy of nodes,
inserting the ones of the "Things" (leaf nodes) incollection nodes related with
the type of data published or their location.Then, when the server component receive the
subscription containing thewildcards, it can translate the request in a subscription to
the collectionnode(s) corresponding with the request.
Following your example, for the node temp1:building/floor/apartment/room/temp1, you have
thishiearchy of nodes:
building (collection)
--> floor (collection)
-> apartment (collection)
-> room (collection)
-> temp(collection)
-> temp1(leaf)
And you can translate the "wildcard" subscriptions in this way:
building/floor/apartment/room/* -> subscription to room collection node
building/floor/apartment/* -> subscription to apartment collectionnode
building/floor/* -> subscription tofloor collection node
building/* -> subscription to buildingcollection node
building/*/*/*/temp -> subscription to all the collection nodes of type temp in
insertedin the building collection node
Thanks,Davide
--
Davide Conzon
Istituto Superiore Mario Boella (ISMB)
via P.C. Boggio, 61 - 10138 Torino (ITALY) tel. (+39) 011.2276.710
Informativa - Art. 13 D.lgs. 196/03
==========================
Il trattamento dei dati ha la finalità di permettere lo svolgimento delle attività di
ricerca, formazione e studio, oltre agli ulteriori servizi messi a disposizione
dall’Istituto Superiore Mario Boella I dati saranno trattati con modalità manuali,
informatiche e/o telematiche; non verranno per nessuna ragione comunicati ad altri
soggetti ed Enti senza previa autorizzazione. Potranno venire a conoscenza dei Vostri dati
il responsabile del trattamento e le categorie di soggetti incaricati del trattamento. In
ogni momento potrà rivolgersi al nostro servizio Privacy per conoscere i suoi dati e farli
integrare, modificare o cancellare per violazione di legge, od opporsi al loro trattamento
e/o per esercitare gli altri diritti previsti dall’art. 7 del D.lgs 196/03. Titolare del
trattamento è la società Istituto Superiore Mario Boella con sede in Via P. Carlo Boggio
n. 61- 10138 Torino.
All information and attachments are reserved and an Istituto Superiore Mario Boella
intellectual property, if you receive this message for error please delete it and contact
info(a)ismb.it.
Da: "Cramer, E.R. (Eelco)" <Eelco.Cramer(a)tno.nl>
A: XMPP in the Internet of Things <iot(a)xmpp.org>
Inviato: Giovedì 30 Aprile 2015 10:26
Oggetto: Re: [IOT] Feedback on pubsub for IoT
Hi Peter,
Interesting! Please see my comments below.
On 29 Apr 2015, at 16:44, Peter Waher <Peter.Waher(a)clayster.com> wrote:
The first idea is a slight modification of the approach: Instead of having the dealer
subscribe to all nodes. This might require a lot of administrative communication, and also
a lot of monitoring/supervision for make sure it recovers from different error states. An
alternative is to make a component connection (XEP-0114) and publish the dealer as a
pubsub server component on the xmpp server, replacing perhaps the “normal” pubsub server.
In this way, the dealer would not need to maintain all subscriptions, instead, it would be
the owner of the nodes itself. Perhaps the added effort here, is comparable or less than
the effort needed to subscribe to all events from a pubsub server, that as you say, anyway
might be lacking in some regards. The dealer could still use the iot-event subscription
architecture, and so, there would not be a need to implement that part, since it doesn’t
provide subscribers to request tailored sets of data.
This is sort of how I was planning to specify this. Except for the need of the ‘dealer’ to
be the ‘owner’ of the device.
The second idea, is a continuation of the above, but providing a “normal” pubsub
subscription interface: Today, the pubsub pattern has a great weakness: It’s not possible
to adapt contents based on rights for individual subscriptions. You need to publish
different sets of content on different nodes, which quickly grows to infinity if you allow
fine-grained control, as is the case for IoT. This not only becomes complicated, it also
quickly removes any gains provided by pubsub, as the basic idea is to reduce the number of
packets required for the publisher, to efficiently publish information to a larger set of
subscribers. So, while one is creating a component for a new type of pubsub service above,
you might build in a connection to a provisioning server (XEP-0324), or build in the same
functionality in the same component, and use <canRead> to check what type of
information is allowed for different subscribers implicitly, removing the need for a
tailored subscription request, as well as a tailored publication, still tailoring output
to each subscriber. That would lift the burden from the device, and provide a completely
new type of service: Context sensitive, or individually tailored, publish/subscribe.
In the ‘dealer’ service I was planning to add a ‘canSubscribe’ message in the provisioning
protocol. The dealer should send that message to the provisioning to see if a subscription
was valid. I like the idea to specify something that makes it as simple as possible for
Things and subscribers to use.
I have thought about implementing the second idea above, myself. I think such a component
might have a very important role for the publish/subscribe pattern in XMPP, and solves
many of the security issues in other pubsub solutions. Would you be interested in
investigating this further?
Sure.
A third idea, based on the second idea above is the following: Something that is missing
from the XMPP pubsub model, but is available in MQTT, is multi-layered publish/subscribe.
While implementing a new context-sensitive pubsub service, this might be something to add.
In MQTT you can listen to a “parent node”, or wildcards, and receive events from all its
(grand*)child nodes for example. Example: Consider you publish a temperature on node
building/floor/apartment/room/temp1. How would you do to listen to all sensors in that
room? Or all sensors in that apartment, floor or building? Or all temperature sensors in
that building (leaving out other kinds of sensors)? Using a wildcard character (*) you
could do this by subscribing to “building/floor/apartment/room/*”,
“building/floor/apartment/*”, “building/floor/*”, “building/*” and “building/*/*/*/temp*”
respectively in one go. That would provide a great way to subscribe to larger sets of
contents, without having to maintain huge amounts of smaller individual subscriptions.
I agree. This is something that needs to be taken into account.
Thanks,Eelco This message may contain information that is not intended for you. If you
are not the addressee or if this message was sent to you by mistake, you are requested to
inform the sender and delete the message. TNO accepts no liability for the content of this
e-mail, for the manner in which you use it and for damage of any kind resulting from the
risks inherent to the electronic transmission of messages.
_______________________________________________
IOT mailing list
IOT(a)xmpp.org
http://mail.jabber.org/mailman/listinfo/iot