From : http://chambersdaily.com/bradleychambers/2014/9/19/technical-details-of-peer-to-peer-airplay
iOS 8 supports the ability to stream content from an iOS device to Apple TV even if the devices are on different networks or there’s no network available. The iOS device uses Bluetooth Low Energy (BTLE) to begin the discovery process of available Apple TV devices and then establishes a connection directly to Apple TV using Wi-Fi.
In iOS 8, peer-to-peer AirPlay lets a user use AirPlay directly from a supported iOS device or Mac to an Apple TV without first connecting to the infrastructure network. Peer-to-peer AirPlay eliminates the need to join the right network or disclose Wi-Fi passwords, avoids reachability issues in complex network environments, and provides a direct path from the AirPlay sender to AirPlay receiver to optimize performance. Peer-to-peer AirPlay is enabled by default in iOS 8 and Mac OS X Yosemite v/10.10, and doesn’t require any user configuration.
Peer-to-peer AirPlay requires:
Apple TV (3rd generation rev A Model A1469 or later) with Apple TV software 7.0
iOS devices (2012 or later) with iOS 8
Mac computers (2012 or later) with OS X Yosemite version 10.10
To find the model number of an Apple TV, see the Apple Support article Identifying Apple TV models.
Peer-to-Peer discovery is initiated using Bluetooth Low Energy (BTLE) when a user selects AirPlay on an iOS 8 or OS X Yosemite v/10.10 device. This causes the device and the Apple TV to visit Wi-Fi channel 149 in the 5 GHz band and Wi-Fi channel 6 in the 2.4 GHz band, where the discovery process continues. Once the user selects an Apple TV and AirPlay starts, the Wi-Fi radios timeshare between channel 149 and whichever infrastructure channel each device is currently using. If possible, the AirPlay sender roams to the same infrastructure channel the Apple TV is using. If neither device is currently using an infrastructure network, the devices will utilize Wi-Fi channel 149 only for AirPlay. Peer-to-peer mirroring adheres to 802.11 standards, sharing Wi-Fi bandwidth with other Wi-Fi devices.
When you deploy Apple TVs on a large enterprise Wi-Fi network, consider the following guidelines:
Connect Apple TVs to Ethernet whenever possible
Don’t use Wi-Fi Channel 149 or 153 for your infrastructure network
Don’t place or mount the Apple TV behind objects that could disrupt the Bluetooth Low Energy and Wi-Fi signals
Note: Bluetooth Low Energy discovery is a distinct subset of peer-to-peer AirPlay.
iOS and Mac devices will continue to use the same discovery methods available today to find AirPlay receivers. AirPlay receivers can advertise themselves using Bonjour or Bluetooth. Discovery over Bluetooth requires iOS 7.1 or later on the following:
Apple TV (3rd generation or later) running software 6.1 or later
iPhone 4s or later
iPad 3rd generation or later
iPad mini 1st generation or later
iPod touch 5th generation or later
To find the model number of an Apple TV, see the Apple support article, Identifying Apple TV models.
Discovered AirPlay receivers appear in the AirPlay menu.
Infrastructure and peer-to-peer are the two supported modes of AirPlay connectivity. If both the AirPlay sender and receiver support peer-to-peer AirPlay, that’s the preferred data path regardless of infrastructure availability. Peer-to-peer AirPlay coexists with infrastructure connections, so the AirPlay client or AirPlay sender can maintain Internet connectivity simultaneously with the peer-to-peer connection. The 5GHz band is better for connecting over peer-to-peer AirPlay, because it provides a fast, direct connection between the AirPlay sender and AirPlay receiver.
Note: If peer-to-peer AirPlay isn’t supported on either the AirPlay sender or receiver, then the infrastructure connection is automatically used.
AirPlay uses AES encryption to ensure that content remains protected when mirroring or streaming from an iOS or Mac device to an Apple TV.
AirPlay access to an Apple TV can be restricted by setting an Onscreen Code or Password. Only users who enter the Onscreen Code (per AirPlay attempt) or Password on their iOS or Mac device can send AirPlay content to an Apple TV.
Enabling Require Device Verification (Requires an iOS device with iOS 7.1 or later or a Mac with OS X Mavericks v/10.9.2 or later.) requires the iOS or Mac device to authenticate on the initial AirPlay connection. Require Device Verification is useful when Apple TV is deployed on an open Wi-Fi network. To ensure iOS and Mac devices are securely paired, the user is prompted to enter in a one-time Onscreen code. Subsequent connections don’t require a code, unless Onscreen Code settings are enabled.
Peer-to-peer AirPlay is always secured with Require Device Authentication. This setting isn’t configurable by the user, and it prevents any nearby rogue users from accessing an Apple TV.
Note: For devices not on an infrastructure network, Bonjour advertisement of supported AppleTV devices (A1469 or later) is triggered by Bluetooth.