Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/29/2010 in all areas

  1. NIM

    What is Bonjour?mDNSResponder?

    1. What is Bonjour? Bonjour, also known as zero-configuration networking, enables automatic discovery of computers, devices, and services on IP networks. Bonjour uses industry standard IP protocols to allow devices to automatically discover each other without the need to enter IP addresses or configure DNS servers. Specifically, Bonjour enables automatic IP address assignment without a DHCP server, name to address translation without a DNS server, and service discovery without a directory server. Bonjour is an open protocol which Apple has submitted to the IETF as part of the ongoing standards-creation process. To learn more, check out theBonjour Protocol Specifications which detail the technologies that make up Link-Local and Wide-Area Bonjour. 2. What is mDNSResponder? mDNSResponder is a Bonjour system service that implements Multicast DNS Service Discovery for discovery of services on the local network, and Unicast DNS Service Discovery for discovery of services anywhere in the world. mDNSResponder is built into Mac OS X and can be downloaded as part of Bonjour for Windows. Applications like iTunes, iPhoto, iChat and Safari use mDNSResponder to implement zero-configuration network music sharing, photo sharing, chatting and file sharing, and discovery of remote user interfaces for hardware devices like printers and web cameras. mDNSResponder is also used to discover and print to Bonjour printers and USB printers connected to the AirPort Extreme and Express base stations. mDNSResponder is open source, and hardware device manufacturers are encouraged to embed themDNSResponder source code directly into their products to benefit from zero-configuration networking. 3. Does Bonjour work between multiple subnets? Yes. The first release of DNS Service Discovery [DNS-SD] for Mac OS X concentrated on Multicast DNS [mDNS] for single-link networks because this was the environment worst served by IP software. Starting in Mac OS X 10.4, Bonjour now uses Dynamic DNS Update [RFC 2316] and unicast DNS queries to enable wide-area service discovery. 4. Does Bonjour support "SOAP" RPC over HTTP? Yes. Bonjour defines a new protocol for discovering services [DNS-SD], however, it places no restrictions on the type of services you discover. Thus you can discover SOAP services just as easily as you can discover iChat buddies and iTunes music libraries. In other words, Bonjour supports SOAP over HTTP as well as every other application protocol layered on top of TCP/IP or UDP/IP. 5. Does Bonjour have any kind of subscription or notification mechanism? Yes. The reason that many people seem to be unaware that Bonjour also does notification is probably because it is simply an intrinsic property of the discovery protocol. With a well-designed discovery protocol, the same protocol that you use to discover some piece of information is also used to discover changes to that information. Discovery of static information, and discovery of variable information, and discovering when variable information changes are all just different points on the same spectrum. For an example of an application using Bonjour "notifications", check out iChat. When you change your Status from "Available" to "Away" or type in a status message, all other iChat clients on the local network are notified of the change. 6. What should I pass in for the "name" parameter when registering a service? By default, you should choose a human-readable name that uniquely describes the service. iTunes, for example, chooses a default music sharing name by combining the computer user's first and last name, as in "Isaac Newton's Music". For most hardware devices, the default service name should be the full make and model of the product. For example, something like "Apple PowerBook G4". Remember, this is only the default name given out of the box, and the user should be allowed to customize the service name to differentiate multiple devices or services on the network. For application developers that are registering services, it may make sense to have one instance of that service on a given computer. In that case, rather than having your application present its own user-interface for the user to enter the name of the advertised service, it's more convenient to register using the system-provided default name known as the "Computer Name" in the Sharing Preference Panel. If you pass in an empty string ("") for the service name when registering, the system will automatically use the "Computer Name". Passing in an empty string will also handle name conflicts by automatically appending a digit to the end of the name. However, there are services where multiple instances may be hosted on the same computer. For example, a print server with three printers should advertise each printer as a first-class entity. Each printer should be advertised using a descriptive name that usefully identifies the printer itself. This is important, because the printer called "Marketing's Transparency Printer" might get moved to a different print server in the future, but the user shouldn't have to be aware of those operational details. They should still see the same service advertised on the network under the same name, even though it's on a different print server now. 7. What should I pass in for the "type" parameter when registering a service? You must pass a string of the form "_applicationprotocol._transportprotocol". Currently "_transportprotocol" must be either "_tcp" or "_udp". Your "applicationprotocol" must be 14 characters or less and should be registered with the DNS-SD Web Site. If your protocol requires a well known port number, you should also register with IANA so they can add you to the list of registered protocol names and port numbers. Please see QA1312 for the list of service types used by Mac OS X. 8. What should I pass in for the "domain" parameter when registering a service? If you pass an empty string (""), then Mac OS X will automatically do the right thing. In Mac OS X 10.2 and 10.3, it will register using just link-local multicast. Starting in Mac OS X 10.4, it will automatically register your service in a user-chosen unicast DNS domain as well, if applicable. You only need to pass a specific string if you have some particular reason to want to register in some specific remote domain. 9. What should happen when two devices on the network both use the same service name? In the rare case where a name collision occurs, your device should add a digit to the end of the name, for example: "Apple Mac mini (2)" Applications and devices that call Bonjour APIs like DNSServiceRegister and CFNetServiceRegisterWithOptions will automatically get this name changing behavior when name conflicts occur. For devices that have a screen and are capable of user input, instead of appending a number, you could optionally decide to prompt the user for a more unique name. 10. What is the TXT record used for? The specific nature of the TXT record and how it is to be used is service type dependent. Each service type will define zero or more name/value pairs used to store meta-data about each service. These name/value pairs should be formatted as described in Section 6 of DNS-Based Service Discovery. Please see QA1306 for information on how TXT records should be formatted when using the Mac OS X APIs. Also, the DNS-SD Web Site has information regarding the currently defined name/value pairs for common service types. 11. After the user browses the network in my application and selects the service instance they wish to use, I should save that IP address in my application's preference file, right? Wrong. This is a common mistake. With DHCP (and with link-local addressing) it is not safe to assume that the service instance will have the same IP address tomorrow. Addresses can change. Service names are the intended stable identifiers for a service instance. Save the instance name (name, type, and domain) in your application's preference file, then Resolve it on demand each time the user accesses the service. Note also that you should not store the host name and port number, because you shouldn't assume that the service instance will necessarily be running on the same port number tomorrow. Instead of storing the host name, store the service instance name (name, type, and domain) and then when you Resolve the service instance name at the time of use you are sure to get the up-to-date IP address and port number. 12. My hardware device has a built-in web server used for configuration. Should I register it using Bonjour? Yes. You should register every service running on your device, for example, HTTP, FTP, SSH, Telnet. The Safari web browser can discover web servers advertised with Bonjour, and Internet Explorer on Windows can discover web servers when Bonjour for Windows is installed. Also, the Terminal application in Mac OS X 10.3 can discover FTP, SSH, and Telnet servers. How To Uninstall or Remove Bonjour mDNSResponder.exe
    1 point
×
×
  • Create New...