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

Other parts of this protocol not supported #5

Open
wesleytodd opened this issue Dec 29, 2015 · 10 comments
Open

Other parts of this protocol not supported #5

wesleytodd opened this issue Dec 29, 2015 · 10 comments

Comments

@wesleytodd
Copy link

Other PR coming your way:

There are three other parts of the dns service name not supported in this module:

._tcp . . .
. ._tcp . . .
._sub . ._tcp . . .

The first example shows the name used for PTR queries. The second shows a Service Instance Name, i.e., the name of the service's SRV and TXT records. The third shows a subtype browsing name, i.e., the name of a PTR record pointing to a Service Instance Name

Not currently supported:

  • Service Instance names
  • The service domain
  • The parent domain

The changes I was thinking of are as follows:

  1. The object form of stringify should take an object of the form: {instance: <String>, name: <String>, protocol: <String>, subtypes: <Array>, serviceDomain: <String>, parentDomain: <String>}
  2. The argument form of stringify should be dropped. With such a complicated set of params this would be a horrible api
  3. The parse method would add matching keys on the returned object

The subtypes is already a breaking change, so my thought is a 2.0 with this and the subtypes would be a good idea. Thoughts?

@watson
Copy link
Collaborator

watson commented Jan 6, 2016

@wesleytodd I can't find any documentation on the difference between service and parent domains. Where did you find info on this?

@wesleytodd
Copy link
Author

@watson
Copy link
Collaborator

watson commented Jan 6, 2016

@wesleytodd I was reading that before but didn't really get that much wiser 😉 Reading it again now I think I interpret it like the following:

<parentdomain>

  • Required
  • If using the local link it's local.
  • It can be set to another domain that is "controlled" by the user, e.g. company-name.com

<servicedomain>

  • Optional
  • It's mostly used in large organisations that need to subdivide services into groups, e.g. building-12, orlando-office or accounting

Is that how you interpret it as well?

@wesleytodd
Copy link
Author

yes mostly, but my assumption was that company-name was intended to be the service domain because otherwise it would be pretty hard to decide if the second part after the . is the service domain or part of the parent domain. Not that that is necessarily that the spec intends, but that any other way would be hard to parse.

@watson
Copy link
Collaborator

watson commented Jan 6, 2016

Just re-read this from the RFC:

[...] This leaves 100 bytes to accommodate the organization's existing domain name <parentdomain>. When used with Multicast DNS, <parentdomain> is "local.", which easily fits.

From this I gather that when using DNS-SD together with mDNS, the <parentdomain> is always local.. But apparently you can use DNS-SD in non-mDNS environments as well in which case "the organization's existing domain name" will be the <parentdomain>. And "existing domain" sounds to me like it's company-name.com, no?

@watson
Copy link
Collaborator

watson commented Jan 7, 2016

I think the algorithm for detecting this would be something like this:

  • If the full domain ends in local. this will be the <parentdomain>
  • If the full domain doesn't end in local. the <parentdomain> will include the stuff before the last period as well, e.g. whatever.tld
  • The domain contains a <servicedomain> if the part before the <parentdomain> isn't either _tcp or _udp

@wesleytodd
Copy link
Author

And "existing domain" sounds to me like it's company-name.com, no?

Yep, didn't see that part, totally agree. So for something like this _http._tcp.foo.example.com what do we get? Seems like this would make foo the service domain?

If the full domain ends in local. this will be the <parentdomain>

So I tried getting local. to work, but for some reason only local worked when I actually registered my services on the network. Not sure why since the spec is pretty clear, but it didnt work for me.

@watson
Copy link
Collaborator

watson commented Jan 7, 2016

And "existing domain" sounds to me like it's company-name.com, no?

Yep, didn't see that part, totally agree. So for something like this _http._tcp.foo.example.com what do we get? Seems like this would make foo the service domain?

Yes

If the full domain ends in local. this will be the <parentdomain>

So I tried getting local. to work, but for some reason only local worked when I actually registered my services on the network. Not sure why since the spec is pretty clear, but it didnt work for me.

Are you referring to the trailing period after "local"? I've been meaning to debug why that's not working. As you say the RFC is pretty clear on that so it should work. It could be a bug in the multicast-dns module - but for now I've just left it out since that seems to work ok without it.

@wesleytodd
Copy link
Author

but for now I've just left it out since that seems to work ok without it

exactly what I did.

Ok, probably this weekened I will take a look at my changes and make sure they incorporate these notes. Thanks!

@watson
Copy link
Collaborator

watson commented Jan 7, 2016

@wesleytodd I'll hopefully get through my backlog of issues and pull requests over the weekend as well 😄

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

No branches or pull requests

2 participants