Section 5.1. Domain Enumeration


5.1. Domain Enumeration

When you browse on the local network, it's clear that the domain you want is local. When you browse on the Internet, you can ask DNS-SD to browse in any valid DNS domain, like apple.com or oreilly.com. Whether you get any results will depend on whether the domain is advertising any services. Clearly, one way to decide which domain(s) to browse is to have the user type them in. However, the spirit of Zeroconf is zero configuration, so we don't want to make the user start manually configuring things now. The computer should automatically learn from its environment about interesting domains to browse. The way DNS-SD does this is with Domain Enumeration queries. DNS-SD performs five Domain Enumeration queries:

  • Where are interesting domains to browse for services?

    The Domain Enumeration query string for this is b._dns-sd._udp.

  • Of that list, what is the recommended default domain to browse?

    The Domain Enumeration query string for this is db._dns-sd._udp.

  • Where are recommended places I might want to register to advertise my services?

    The Domain Enumeration query string for this is r._dns-sd._udp. (Advertising services may require authorization and credentials, so just because a given domain is recommended to people on this network doesn't necessarily mean that you have permission to advertise services there.)

  • Of that list, what is the recommended default domain to register services?

    The Domain Enumeration query string for this is dr._dns-sd._udp.

  • For legacy client applications that don't specify any particular domain when browsing for services, are there any additional domains that we should browse in addition to the usual local domain?

    The Domain Enumeration query string for this is lb._dns-sd._udp.

When your laptop finds itself on a new network, it typically learns certain information from the DHCP server, including the address it's been assigned, the netmask for that network, the address(es) of one or more DNS services, and the default DNS search domain recommended for users on that network.

DNS-SD uses this information to construct its Domain Enumeration queries in two ways: domain- and address-based .

The first way is a domain-based query. DNS-SD takes each of the five Domain Enumeration query strings above, appends the default DNS search domain, and does a PTR query. For example, at Apple, the DHCP server informs clients that the domain is apple.com, so DNS-SD will do a PTR query for lb._dns-sd._udp.apple.com. to determine if browse operations done by legacy clients should browse any other domain in addition to local.

The second way is an address-based query, which allows more fine-grained, location-specific defaults to be fed to clients based on which network segment they are on. DNS-SD does address-based queries by taking the client's IP address and performing a logical AND operation with the netmask to get the base address for the subnet. This address is then reversed in the manner of a normal in-addr.arpa reverse lookup, and this name is then appended to each of the Domain Enumeration query strings. For example, if the client's IP address is 192.168.1.2 and the netmask is 255.255.0.0, then the base address for the subnet is determined to be 192.168.0.0, and DNS-SD will do a PTR query for lb._dns-sd._udp.0.0.168.192.in-addr.arpa. to determine if there's a recommended legacy browse domain for that particular network.




Zero Configuration Networking. The Definitive Guide
Zero Configuration Networking: The Definitive Guide
ISBN: 0596101007
EAN: 2147483647
Year: 2004
Pages: 97

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net