The iPhone and iPod Touch devices have various means of communication with hosts and accessories. This communication is typically over USB excepting analogue video and audio, which themselves vanished with the new [[wikipedia>​Lightning_(connector)|Lightning connector]]. The current devices present several USB [[http://​www.beyondlogic.org/​usbnutshell/​usb5.shtml#​ConfigurationDescriptors|configurations]] each of which has one or more [[http://​www.beyondlogic.org/​usbnutshell/​usb5.shtml#​InterfaceDescriptors|interfaces]]. The list of configurations on an **iPhone 4** and the interfaces presented is shown below:

Conventional accessories typically communicate by switching the device into USB configuration **2**, which makes audio and HID interfaces available. The HID interface is then used to speak the [[http://​ipl.derpapst.eu/​wiki/​Apple_Accessory_Protocol|iPod Accessory Protocol]] (iAP) using HID reports as a transport for iAP packets. This requires authentication using a chip which Apple provide, however, so they can retain control of the accessory ecosystem.

-

-

iTunes communicates using a different method, however, since it has to run on consumer PCs which don't have any special authentication hardware. Configuration **4** contains vendor-specific interfaces which are used to multiplex TCP-like connections over the USB link to connect to services on the device. Here are some useful links about this process:

-

-

* [[http://​wikee.iphwn.org/​usb:​usbmux|usbmux]] --- an overview of the architecture and some protocol exchanges.

-

* [[http://​marcansoft.com/​blog/​2009/​10/​iphone-syncing-on-linux/​|Linux usbmuxd]] --- a blog post about the stack used on Linux to communicate with iDevices.

-

* [[http://​cgit.sukimashita.com/​usbmuxd.git/​tree/​README|usbmuxd README]] --- the README from the above project'​s repository, which has some more useful information.

-

-

To facilitate the operation of ''​usbmuxd''​ the device needs to be put into the appropriate USB configuration. The following is an excerpt from ''/​lib/​udev/​rules.d/​85-usbmuxd.rules''​ (line breaks added for clarity):