AirPlay discovery in Apple devices
A device can discover Apple TV using any of three methods:
Bluetooth IP address advertisement
Devices prefer peer-to-peer discovery but will typically establish a connection using the method that’s the most responsive or the one most recently used.
To learn more about Bonjour, see Bonjour overview.
Apple TV also broadcasts its AirPlay capabilities using a Bluetooth® Low Energy (BTLE) advertisement that contains the IP address of the Apple TV. Apple devices within close proximity of the Apple TV, generally within the same room, hear those advertisements and attempt to establish an AirPlay session over the existing network. This method doesn’t use Bonjour, nor does it require that both devices be on the same network. As long as the devices are within Bluetooth range to hear the advertisement and there are no firewalls restricting access from the source device to the Apple TV, this method should work. To find the model number of an Apple TV, see Identifying Apple TV models.
iOS, iPadOS, macOS and tvOS have the ability to do peer-to-peer discovery. This is used for more than just AirPlay. AirDrop, Continuity and other device-to-device technologies take advantage of the same technology.
When looking for other devices, an Apple device broadcasts a very small Bluetooth advertisement indicating that it’s looking for peer-to-peer services. When any peer-to-peer-capable device hears this BTLE packet, it creates or joins a peer-to-peer network directly between the devices. The devices concurrently switch between this temporary network and the infrastructure network(s) they were on before in order to deliver both the AirPlay video stream and provide existing internet service. The temporary network typically operates on Wi-Fi channel 149+1, but depending on the hardware involved, may also include channel 6, or channel 149,80. The devices follow the same frequency use rules on the temporary network as they do with any other Wi-Fi connection to avoid disrupting any existing infrastructure networks that might already be using those channels.
Important: Some countries and regions may set their own regulations for channel 149. For more information, check the 5 GHz section of the List of WLAN channels wikipedia webpage. Where use of channel 149 isn’t allowed, the temporary peer-to-peer network will operate on Wi-Fi channel 44 and, in most of Europe, on Wi-Fi channel 42.
It’s also important to note that neither device must be associated with an existing infrastructure network for peer-to-peer discovery to work, though it’s encouraged for software updates and internet-provided content. Peer-to-peer Airplay requires the following hardware:
Apple TV 4th generation with tvOS 9.0 or later, or Apple TV 4K with tvOS 11.0 or later
iPhone, iPad and Mac computers from late 2012 or later running the latest version of the operating system
tvOS also contains a setting that allows you to choose — or manage with a mobile device management (MDM) payload — how users connect to Apple TV:
Everyone can use AirPlay: Users connect only over peer-to-peer to Apple TV.
Anyone on the same network can use AirPlay: Users on the same Wi-Fi network can AirPlay to Apple TV.
Off: AirPlay is disabled, and users won’t be able to AirPlay toApple TV.