Service discovery

Service discovery

Overview

AirPlay devices do service discovery through multicast DNS (mDNS) and the zeroconf protocol. Apple is known to use its own implementation called Bonjour. The communication between sender and receiver can take place on port 7000/TCP or on any other TCP port declared by the receiver in its mDNS record.

_airplay._tcp.

The _airplay service appeared when AirPlay was initially introduced. This is also the service AirPlay 2 is currently using.

An AirPlay 2 sender inspects the following TXT records, including all the _raop._tcp entries and adding new ones. features is the most important record and controls what are the “inner” properties of an AirPlay receiver. It's analyzed in the following section, Features.

FromTXTRecord ToDict Type Explanation
fv firmwareVersion String Firmware version
acl accessControlLevel Int64 Access control level
btaddr bluetoothAddress String Bluetooth address
deviceid deviceID String Device ID
features features Int64 Features
rsf requiredSenderFeatures Int64 Required sender features
flags systemFlags Int64 System flags
gcgl groupContainsDiscoverableLeader Boolean Group contains discoverable leader
gid groupUUID String Group UUID
gpn groupPublicName String Group public name
igl isGroupLeader Boolean Is group leader
hgid homeGroupUUID String Home group UUID
hmid householdID String Household ID
pgcgl parentGroupContainsDiscoverableLeader Boolean Parent group contains discoverable leader
pgid parentGroupUUID String Parent group UUID
tsid tightSyncUUID String Tight sync UUID
hkid homeKitHomeUUID String HomeKit home UUID
model deviceModel String Device model
manufacturer manufacturer String Manufacturer
serialNumber serialNumber String Serial number
protovers protocolVersion String Protocol version
pi publicCUAirPlayPairingIdentity String Public CU AirPlay pairing identity
psi publicCUSystemPairingIdentity String Public CU System Pairing Identity
pk publicKey String Public key
srcvers airPlayVersion String AirPlay version
osvers OSVersion String OS version

Example: mDNS for a Sonos One receiver

acl=0
deviceid=AA:BB:CC:DD:EE:FF
features=0x445F8A00,0x1C340
rsf=0x0
fv=p20.53.3-71050
flags=0x404
model=One
manufacturer=Sonos
serialNumber=AA-BB-CC-DD-EE-FF:6
protovers=1.1
srcvers=366.0
pi=<UUID>
gid=<UUID>
gcgl=0
pk=<32B hex encoded public key>

_airplay-p2p._tcp.

The _airplay-p2p service was introduced to stream content to Apple TVs without having to be connected to the same local network.

_raop._tcp.

RAOP stands for Remote Audio Output Protocol. The _raop service was introduced for audio streaming only when _airplay was supporting only photo and video streaming only

FromTXTRecord ToDict Type Explanation
cn compressionTypes BitList Compression types
da rfc2617DigestAuthKey Boolean RFC2617 digest auth key
et encryptionTypes BitList Encryption types
ft features Int64 Features
fv firmwareVersion String Firmware version
sf systemFlags Int64 System flags
md metadataTypes BitList Metadata types
am deviceModel String Device model
pw password Boolean Password
pk publicKey String Public key
tp transportTypes String Transport types
vn airTunesProtocolVersion String AirTunes protocol version
vs airPlayVersion String AirPlay version
ov OSVersion String OS version
vv vodkaVersion Int64 Vodka version