Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discover Web Things via mDNS #696

Closed
benfrancis opened this issue Feb 20, 2018 · 13 comments
Closed

Discover Web Things via mDNS #696

benfrancis opened this issue Feb 20, 2018 · 13 comments
Assignees
Milestone

Comments

@benfrancis
Copy link
Member

As a user I want to search for things which are broadcasting their URL on the local network so I can add them to my gateway

Let's experiment with discovering things using mDNS to broadcast their URL.

@mrstegeman
Copy link
Contributor

webthing-python and webthing-node have been implemented to broadcast an mDNS service with type _wot._tcp and a url field in the TXT record.

@hobinjk
Copy link
Contributor

hobinjk commented Mar 13, 2018

I was using var browser = mdns.createBrowser(mdns.tcp('http', 'webthing')); locally which I think is a bit more semantic (_http._tcp,_webthing, "a tcp service providing http that uses the webthing api"). I took this approach from http://agnat.github.io/node_mdns/user_guide.html#service_types

@hobinjk
Copy link
Contributor

hobinjk commented Mar 13, 2018

I was also using href instead of url but your use of url is much better and more semantic so I'll modify accordingly.

@mrstegeman
Copy link
Contributor

@hobinjk I'm fine with that. Is webthing supposed to be a sub-type? If so, I believe it should be mapping to _webthing._sub._http._tcp, not _http._tcp,_webthing. Maybe that's just what mdns uses internally?

@mrstegeman
Copy link
Contributor

Yep, that works.

@hobinjk
Copy link
Contributor

hobinjk commented Mar 13, 2018

Oh, that's interesting, it should be _webthing._http._tcp, it looks like the comma syntax is just what mdns and the dns-sd utility use internally

@mrstegeman
Copy link
Contributor

According to this book, you use the comma format when browsing, but on the network, a subtype actually maps to an additional PTR record with the format _webthing._sub._http._tcp.

@hobinjk
Copy link
Contributor

hobinjk commented Mar 13, 2018

Oh wow this is much more confusing and convoluted than I thought it would be. Thanks for the reference! Do you think it makes more sense as _webthing._sub._http._tcp or as _webthing._tcp?

@mrstegeman
Copy link
Contributor

It makes more sense to me to do the sub-type. It's a bit easier to do it the other way, but this seems more proper.

@benfrancis
Copy link
Member Author

See also https://tools.ietf.org/html/rfc6763

An example in the RFC is _printer._sub._http._tcp.<Domain> so _webthing._sub._http._tcp seems reasonable.

Do you think a _webthing subtype is something we could propose as a standard in a "Thing Discovery" section of our Web Thing API spec? Presumably that would include defining the field in the TXT record where you can find the URL of the thing description.

There appears to be an IANA registry for service types but it doesn't seem to include any sub-types. It doesn't even include http.

@mrstegeman
Copy link
Contributor

I definitely think the subtype would be good to include, along with the Eddystone beacon format, if that's something we want to push forward.

@mrstegeman
Copy link
Contributor

mrstegeman commented Mar 14, 2018

And yes, HTTP is included: https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?&page=2

But I don't see any subtypes in there.

@mrstegeman
Copy link
Contributor

This is supported by https://github.com/mozilla-iot/thing-url-adapter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants