4 ms·
UDP broadcast is probably much simpler to implement and the code to implement it is likely to be cross platform, whereas using ZeroConf would require interfacin
by zdw 11y ago
UDP broadcast is probably much simpler to implement and the code to implement it is likely to be cross platform, whereas using ZeroConf would require interfacing either with the native platform's specific implementation, or including it's own implementation when the platform lacked one, and then dealing with interoperability issues between all the platforms.
- teddyh 11y agoInteroperability shouldn’t be an issue – that’s what a standardized protocol is for. MacOS X has Bonjour already built-in. On Linux you can simply require Avahi. For Windows there seems to be a large selection of available ZeroConf libraries, depending on your implementation language (unless you want to simply require Apple’s “Bonjour Print Services for Windows” bundle).
- voltagex_ 11y ago>For Windows there seems to be a large selection of available ZeroConf libraries Not the last time I looked. Apple's SDK seems to be the defacto implementation on Windows. https://learn.adafruit.com/bonjour-zeroconf-networking-for-windows-and-linux/overview https://learn.adafruit.com/bonjour-zeroconf-networking-for-w... - hah, looks like you need to get iTunes if you want the newest Bonjour. I might write something to extract it from the installer. I wonder how many EULAs I'd break in the process.
- voltagex_ 11y agoAlso: https://developer.apple.com/softwarelicensing/agreements/pdf/bonjour4win.pdf https://developer.apple.com/softwarelicensing/agreements/pdf...
- ccccccc 11y agoWasn't Windows 10 supposed to come with an mDNS/DNS-SD stack?
- m_eiman 11y agoIt does, and there's apparently something in it that's not what Avahi expects, which causes Avahi to spam your syslog with "invalid packet received" maany times. And there's no option to tell avahi to shut up about it :/
- ccccccc 11y agoOh yeah I saw something on the Avahi mailing list the other day about that: http://lists.freedesktop.org/archives/avahi/2015-October/002390.html http://lists.freedesktop.org/archives/avahi/2015-October/002...
- michaelmior 11y agoYou just mentioned three different things necessary for three different platforms. I could imagine it being easier to write a simple platform-independent piece to handle the subset of functionality Dropbox needs.
- lukeh 11y agoI'm sure Dropbox has the engineering resources to support Zeroconf is they want to :)
- ccccccc 11y agoApple's C DNS-SD API[1] is available on OS X and Windows and Avahi offers a shim that implements a decent subset of it. 1: https://developer.apple.com/library/mac/documentation/Networking/Conceptual/dns_discovery_api/Introduction.html https://developer.apple.com/library/mac/documentation/Networ...
- ccccccc 11y agoDown votes for pointing out the same API is available on three platforms? (And iOS and recent Androids for that matter.)
- zurn 11y ago> Interoperability shouldn’t be an issue – that’s what a standardized protocol is for. It's definitely an issue with many cases. Unfortunately people make mistakes in implementation and standards have ambiguities, so a common case is doing a lot of interop experiments and code tweaks, and your position is going to be weak if you're not a big player: Others won't test their changes against you and their changes may break your interop. Depends a lot on the complexity and maturity of the protocol of course, cost/convenience of interop testing, whether there's a de-facto standard/dominant implementation to be bug compatible with, and whether you need (m)any-to-(m)any interop or not. Something like Bluetooth is going to be the worst case because it's physical devices, can't test it remotely and you need many-to-many interop testing and there are a zillion implementors with varying levels of competency... and something like SMB is going to be easy because everyone talks to 1-2 server implementations and they're just software. Zeroconf might be somewhere in between.
- teddyh 11y agoZeroConf is a relatively simple protocol, and there are only a few implementations on the OS level. Since Dropbox control both sides of the protocol, and only run on operating systems (and not on embedded devices), they could easily ensure that all their implementations interoperate by testing all combinations.
- zurn 11y agoThis subthread was about zdw's option b) of Dropbox having to support both the OS protocol implementation and its own. In which case Dropbox would not control both sides of the protocol. I think the protocol fairly complex and simultaneously underspecified (if by ZeroConf you mean mDNS and DNS-SD). Mash up multicast, DNS, dynamic DNS updates, and DNS-SD so that every node is running in effect both a DNS server and client... what could possibly go wrong ;)
- koffiezet 11y ago> relatively simple protocol We must have a completely different definition of 'relatively simple' then.
- rakoo 11y agoIt shouldn't be an issue, but it actually is. There is the exact same problem in bittorrent space: there's a BEP (extension) for discovering peers using Zeroconf (BEP 0026, as can be read in [1]) and "Local Peer Discovery" that doesn't even have a BEP. The Zeroconf way is kind of cumbersome, especially if you don't have an easy way to do the whole mDNS and DNS-SD. And since Windows doesn't have a native way to do this (you need to use the Apple SDK) and it seems most bittorrent users are Windows users, nobody seriously bothered with that. LPD on the other hand is the simplest thing you can ever think about (https://forum.utorrent.com/topic/54306-local-peer-discovery-documentation/ https://forum.utorrent.com/topic/54306-local-peer-discovery-...): > in short: join the multicast group 239.192.152.143:6771 and listen for SSDP messages. Every 5 minutes, announce yourself to the multicast group by sending this message: > snprintf(msg, 200, "BT-SEARCH * HTTP/1.1\r\n" "Host: 239.192.152.143:6771\r\n" "Port: %d\r\n" "Infohash: %s\r\n" "\r\n\r\n", listen_port, ih_hex); I'll agree with you that if everyone talked Zeroconf it would be great, but the truth is, it's far too heavy and difficult compared to the alternative of polling a simple UDP socket, which pretty much any language can do easily. [1] http://bittorrent.org/beps/bep_0026.html http://bittorrent.org/beps/bep_0026.html