On a traditional network running TCP/IP, network devices must know the IP addresses of each other before they can communicate. Compared with an IP address, a domain name is easier to remember. The network administrator may configure DNS so that devices can communicate using domain names. To communicate other devices using domain names, a device must be configured with the DNS server to resolve the IP addresses matching the domain names. To reduce manual configuration costs of network devices, Apple proposes Zero-Configuration networking (Zeroconf).
Zero-configuration networking is widely used in residential wireless networks and enterprise office networks. This networking allows network devices to automatically obtain IP addresses, resolve domain names, and discover services. Bonjour is a zero-configuration networking solution based on Multicast Domain Name System (mDNS) and DNS-Based Service Discovery (DNS-SD), and applies to Layer 2 broadcast domains. It uses to allow network devices in a Layer 2 broadcast domain to obtain IP addresses and discover services. Most Apple products such as iPhone, iPad, and Apple TV support Bonjour.
Bonjour implements only intra-VLAN service discovery. To implement service discovery across VLANs, Huawei proposes the mDNS gateway. The mDNS gateway records a list of all available printing and Airplay services, and responds to service requests of Bonjour terminals so that the terminals can discover services across VLANs and network segments.
Bonjour-capable service provisioning devices such as Apple TV advertise their available services using a multicast address (IPv4 address 224.0.0.251). User terminals such as iPhone and iPad send mDNS request packets with the destination multicast address of 224.0.0.251 to request available services on local networks. In this way, Bonjour implements service sharing and allows clients to easily access service resources.
However, the destination multicast address of 224.0.0.251 used by mDNS is only valid within a Layer 2 broadcast domain. That is, information cannot be forwarded across VLANs or Layer 3 devices. As shown in Figure 1, multiple VLANs or network segments are planned on an enterprise network. Apple TV_1, Apple TV_2, and Printer are located on different network segments. The iPhone in VLAN 10 can discover services of Apple TV_1 in VLAN 10 only, and cannot discover services of Apple TV_2 in VLAN 20 or services of Printer connected to the Switch2.
The mDNS gateway solves the problem. A mDNS gateway is deployed on the Switch2 to discover services across VLANs. After the mDNS gateway is deployed on the Switch2, service provisioning devices (Apple TV_1, Apple TV_2, and printer in Figure 1) on the same network segment as the Switch2 multicast mDNS packets to advertise their services. After receiving the mDNS packets, the Switch2 records service information. After receiving an mDNS packet to request service discovery from a client (iPhone in Figure 1), the Switch2 searches its service lists and replies with available services, implementing inter-VLAN service discovery.
In the mDNS gateway solution, ensure that service provisioning devices and the Switch2 working as the mDNS gateway are located on the same network segment. In Figure 1, if the Switch2 connects to the Apple TV and iPhone across network segments, that is, a Layer 3 network exists between the Switch1 and Switch2, mDNS packets in VLAN 10 and VLAN 20 cannot be forwarded by the Switch1 to the gateway. Therefore, the mDNS gateway cannot record services provided in VLAN 10 and VLAN 20. In this case, deploy an mDNS relay on the Switch1 to discover services across network segments.