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 and network segments, Huawei proposes the mDNS gateway and mDNS relay. The mDNS relay is responsible for forwarding mDNS packets exchanged between Bonjour-compliant terminals or service provisioning devices and mDNS gateway so that the Bonjour-compliant terminals can discover printer and Airplay services across 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. 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 AC.
The mDNS gateway implements inter-VLAN service discovery. Huawei AC (AC in Figure 1) of V200R005C00 or later supports the mDNS gateway. The mDNS gateway records all available services, and responds to service requests of Bonjour-compliant terminals. The mDNS gateway can discover services across VLANs. After the mDNS gateway is deployed on the AC, service provisioning devices (Apple TV_1, Apple TV_2, and printer in Figure 1) on the same network segment as the AC multicast mDNS packets to advertise their services. After receiving the mDNS packets, the AC records service information. After receiving an mDNS packet to request service discovery from a client (iPhone in Figure 1), the AC searches its service lists and replies with available services, implementing inter-VLAN service discovery.
Ensure that Bonjour-compliant devices and the AC working as the mDNS gateway are located on the same network segment, that is, the switch and AC in Figure 1 implement Layer 2 forwarding. If the AC connects to the Apple TV and iPhone across network segments, for example, Layer 3 network between the switch and AC in Figure 2, mDNS packets in VLAN 10 and VLAN 20 cannot be forwarded by the switch to the gateway because mDNS packets are multicast in a Layer 2 broadcast domain. Therefore, the mDNS gateway cannot record services provided in VLAN 10 and VLAN 20 or receive mDNS request packets in VLAN 10 and VLAN 20. To address this issue, deploy the mDNS relay on the switch to discover services across network segments. After the mDNS relay is deployed on the switch, the switch converts mDNS packets from the Apple TV or iPhone into unicast packets and sends them to the specified mDNS gateway. Similarly, after receiving mDNS unicast packets from the mDNS gateway, the mDNS relay converts unicast packets into multicast packets and sends them in the specified VLAN to implement service discovery across network segments.