[Development] Requesting New Repository - QtZeroConf

Hausmann Simon Simon.Hausmann at theqtcompany.com
Thu Sep 10 22:34:19 CEST 2015


Hi,

Given that mdns uses an unprivileged port, it seems like to me it should be possible
for just about any process to send and receive mdns queries. Which means that any
app could participate in the mdns groups by itself if it wanted. The primary advantage
that I can see with re-using a running daemon is that the daemon can detect if your
process crashes and clear out the distributed DNS records. If the app takes care of
that by itself, then it would have to deliberately use short TTLs I think.

Interestingly enough, the protocol doesn't seem to be that complicated. A cross-platform
implementation written in Go is under 1000 LOC (server and client, count includes comments):

    https://github.com/hashicorp/mdns


So an alternate approach would be to try to implement the protocol by itself.


Another option that I think would be viable is to go up in the level of abstraction
and try to come up with an API that allows discovery and publishing of network
services on mdns as well as UPNP at the same time. Then the windows version could
just re-use UPNP APIs in Windows and on the other OSes we use zeroconf.

That way there's no deployment issue at all, no windows administrator rights are needed
to install and run a service (apple mdns), etc.


Simon
________________________________________
From: development-bounces+simon.hausmann=theqtcompany.com at qt-project.org <development-bounces+simon.hausmann=theqtcompany.com at qt-project.org> on behalf of drwho at infidigm.net <drwho at infidigm.net>
Sent: Thursday, September 10, 2015 22:29
To: Knoll Lars
Cc: Thiago Macieira; development at qt-project.org
Subject: Re: [Development] Requesting New Repository - QtZeroConf

>>>> Apple's bonjour lib is like avahi-client in that it connects to
>>>> mDNSResponder.  mDNSResponder, or something like it is built into OSx
>>>> and
>>>> iOS, but on windows comes in Apple's print services.
>
> I remember that we tried using the bonjour libs for a project inside the
> Qt company, and I don't remember that we needed any print services from
> Apple. But I could very well be wrong.

I think it used to be called mDNSResponder.

>>When I briefly tried it (2 months ago) I think it was an issue with the
>>unix style sockets.  Googling didn't show much.  If it did work, I
>> suspect
>>it would be buggy as avahi really complains when it detects multiple
>> mDNS
>>stacks running.
>
> So the problem would be to detect if a mDNS stack is already running, and
> if not start the service somehow?

Hmmm, maybe mDNSResponder (or whatever it is called now) could be built
along with QtZeroConf for windows?  Seems ugly.

> Or is there a way to make it possible to run multiple stacks on one host
> (ie. Is having only one stack a limitation in the protocol or the
> implementation)? It would be great if we could simply do this in process.

Both Apple (on windows) and avahi have a daemon for the mDNS stack.  I'm
not an mDNS expert, but I really think if it could be done in multiple
processes they would have made a way for it.  This is the warning avahi
spits out when it detects another stack

*** WARNING: Detected another IPv4 mDNS stack running on this host. This
makes mDNS unreliable and is thus not recommended. ***
*** WARNING: Detected another IPv6 mDNS stack running on this host. This
makes mDNS unreliable and is thus not recommended. ***

Jon

_______________________________________________
Development mailing list
Development at qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


More information about the Development mailing list