Discussion:
bsd licensed mdnsd project
(too old to reply)
Christiano F. Haesbaert
2010-03-08 13:21:59 UTC
Permalink
Hello,

I've seen the interest in a mdns implementation on the NetBSD Projects Page:
http://www.netbsd.org/contrib/projects.html#mdns

But afaik NetBSD has apple's mdnsd already in base, correct ?

Anyway, I'm writing a bsd licensed mdnsd for OpenBSD, I suppose it could
be used in NetBSD without much effort.

If you're still interested in having a bsd licensed daemon here is the
original post do ***@openbsd.org, it's far from usable, but it works
already.

http://github.com/haesbaert/mdnsd

== My original post to ***@openbsd.org ==

Hi there,

Some of you may already know that I'm working on an open mdns
implementation, avahi is gpl and apple's mdnsd is apache2, so that
leaves us with no choice. Some devs have expressed interest in having
a mdns implementation, I thought it would be fun so here it is :P.

So I've started mdnsd, if you guys like it, maybe it can be called
OpenMDNSd in the future.

The daemon is OpenBSD-like, that is, libevent, imsg framework and all,
most code has been based on ripd/ospfd, style(9) is respected.

For those who are unfamiliar with mdns:
What is MulticastDNS and DNS Service Discovery:
MDNS Is a way to resolve/publish DNS records using multicast. DNS-SD
is a way to do proper network browsing using DNS, be it basic unicast
or multicast dns, you can for example browse things like "which are
the webpages being served in this network?", "who's serving NTP in
this network?" and so on.
I indent to fully support mdns/dns-sd.

Background:
For simple mdns name lookups (A records) not very much is needed, but
mdns is a multicast protocol so it must not be chatty, therefore the
draft specifies a full cache coherency and ways to prevent unnecessary
traffic, because of that we need a daemon, which should be the only
responder/querier, he must keep all learned records and answer all
published records. (Multiple responders/queriers is evil)

Applications that make use of mdns, should talk with the daemon
through the control socket (there is a bare bone implementation in
mdns_api.c which is used by mdnsctl).

Mdnsd is this daemon, applications connect through it's unix domain
socket in order to publish and lookup records/services.  Mdns works on
the .local domain, so in order for libc to resolve .local names, my
proposal is to add another entry in the "lookup" keyword for mdns, so
that any query to a .local ending name will be sent to mdnsd.

What's working so far ?
      * Mdnsctl program to interact with the daemon, lookup and
      lookupaddr are fully functional. This is in the same fashion as
      ripctl and friends...
      * Publishing of hostname.
      * Answering/Quering for hostnames.
      * Quering reverse lookup (address lookups).
      * Probing for unique names.
      * Caching, expiring and most of cache coherency.
      * Listen to network events though AF_ROUTE and republish
      records when needed.
      * That's around 5300 lines.

What's missing:
      * Support for DNS-SD.
      * Known answer suppression.
      * Name compression.
      * Support for sending records in more than one packet.
      * Name conflict resolution
      * Libc integration.
      * Shit loads of stuff.

Where to get:
     I'm hosting it at
     http://github.com/haesbaert/mdnsd

     You need to make sure user and group _mdnsd gets created, also
     make sure to enable multicast in your host, see netstart(7) for
     a detailed description. It must be run as root but it will drop
     privileges.

I'm having a great time coding this, I hope you all enjoy as much as I
do.

Sorry for the long post.

--
Christiano Farina HAESBAERT
Do NOT send me html mail.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Matthias Scheler
2010-04-01 07:46:26 UTC
Permalink
Post by Christiano F. Haesbaert
Some of you may already know that I'm working on an open mdns
implementation, avahi is gpl and apple's mdnsd is apache2, so that
leaves us with no choice. Some devs have expressed interest in having
a mdns implementation, I thought it would be fun so here it is :P.
What API do you intend to support? A daemon alone is unfortunately not
very useful because program won't be able to register with it.

Kind regards
--
Matthias Scheler http://zhadum.org.uk/

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Christiano F. Haesbaert
2010-04-01 13:07:11 UTC
Permalink
Post by Matthias Scheler
Post by Christiano F. Haesbaert
Some of you may already know that I'm working on an open mdns
implementation, avahi is gpl and apple's mdnsd is apache2, so that
leaves us with no choice. Some devs have expressed interest in having
a mdns implementation, I thought it would be fun so here it is :P.
What API do you intend to support? A daemon alone is unfortunately not
very useful because program won't be able to register with it.
I'll develop a library using the imsg framework, as I didn't start
coding dns-sd features yet, I haven't thought much of the API.

The current API provides simple synchronous mdns lookups:
mdns_lkup
mdns_lkup_addr
mdns_lkup_hinfo

Each call is stateless (read: it connects to the daemon makes the
request and waits for the answer, then it disconnects).

I'm aware that this isn't sufficient for for dns-sd, I had a look at
avahi's and bonjour's API, and quite frankly, I think they're bloated,
it seems too complicate considering it's such a simple task (register
services/browse services).
I'm aware that Avahi followed some of bonjour API's design.

Summing up, I'll design a whole new API.

At this time I'm working on name conflicts and name compression.

obs: I'm not subscribed to the list, so CC me please.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Matthias Scheler
2010-04-01 13:41:18 UTC
Permalink
Post by Christiano F. Haesbaert
Summing up, I'll design a whole new API.
Why I can appreciate your reason for doing so I personally don't
think this is will be sufficient.

There is just too much software out there (e.g. bits of GNOME) which
were written to the Avahi or Bonjour API. And fortunately neither
of those libraries talk to the other daemon.

So it would be really nice to have wrappers for at least one or
better both of those APIs.

Kind regards
--
Matthias Scheler http://zhadum.org.uk/

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Christiano F. Haesbaert
2010-04-01 13:59:43 UTC
Permalink
Post by Matthias Scheler
Post by Christiano F. Haesbaert
Summing up, I'll design a whole new API.
Why I can appreciate your reason for doing so I personally don't
think this is will be sufficient.
Thanks :P.
Post by Matthias Scheler
There is just too much software out there (e.g. bits of GNOME) which
were written to the Avahi or Bonjour API. And fortunately neither
of those libraries talk to the other daemon.
True, I wanted to have OpenBSD daemons registering their services,
like ntpd, ripd, httpd, sshd and so on, my first idea was not much on
the desktop side.
Post by Matthias Scheler
So it would be really nice to have wrappers for at least one or
better both of those APIs.
I agree, if we want it to work with existing apps, that is a must.
I'll probably end up doing it, but that will take some time.

I need to study avahi/bonjour further when I get to dns-sd.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...