Universal Plug and Play
UPnP is a set of Internet Protocol-based networking protocols that permits networked devices, such as personal computers, printers, Internet gateways, Wi-Fi access points and mobile devices, to seamlessly discover each other's presence on the network and establish functional network services. UPnP is intended primarily for residential networks without enterprise-class devices. Officially, only the abbrevations UPnP and UPnP+ are trademarked.
UPnP assumes the network runs IP, and then uses HTTP on top of IP to provide device/service description, actions, data transfer and event notification. Device search requests and advertisements are supported by running HTTP on top of UDP using multicast. Responses to search requests are also sent over UDP, but are instead sent using unicast.
Conceptually, UPnP extends plug and play—a technology for dynamically attaching devices directly to a computer—to zero-configuration networking for residential and SOHO wireless networks. UPnP devices are plug-and-play in that, when connected to a network, they automatically establish working configurations with other devices, removing the need for users to manually configure and add devices through IP addresses.
UPnP is generally regarded as unsuitable for deployment in business settings for reasons of economy, complexity, and consistency: the multicast foundation makes it chatty, consuming too many network resources on networks with a large population of devices; the simplified access controls do not map well to complex environments.
Overview
The UPnP architecture allows device-to-device networking of consumer electronics, mobile devices, personal computers, and networked home appliances. It is a distributed, open architecture protocol based on established standards such as the Internet Protocol Suite, HTTP, XML, and SOAP. UPnP control points are devices which use UPnP protocols to control UPnP controlled devices.The UPnP architecture supports zero-configuration networking. A UPnP-compatible device from any vendor can dynamically join a network, obtain an IP address, announce its name, advertise or convey its capabilities upon request, and learn about the presence and capabilities of other devices. Dynamic Host Configuration Protocol and Domain Name System servers are optional and are only used if they are available on the network. Devices can disconnect from the network automatically without leaving state information.
UPnP was published as a 73-part international standard ISO/IEC 29341 in December 2008.
Other UPnP features include:
; Media and device independence: UPnP technology can run on many media that support IP, including Ethernet, FireWire, Infrared, home wiring and Radiofrequency. No special device driver support is necessary; common network protocols are used instead.
; User interface control: Optionally, the UPnP architecture enables devices to present a user interface through a web browser.
; Operating system and programming language independence: Any operating system and any programming language can be used to build UPnP products. UPnP stacks are available for most platforms and operating systems in both closed- and open-source forms.
; Programmatic control: UPnP architecture also enables conventional application programmatic control.
; Extensibility: Each UPnP product can have device-specific services layered on top of the basic architecture. In addition to combining services defined by the UPnP Forum in various ways, vendors can define their own device and service types. They can extend standard devices and services with vendor-defined actions, state variables, data structure elements, and variable values.
Protocol
UPnP uses common Internet technologies. It assumes the network must run Internet Protocol and then uses HTTP, SOAP and XML on top of IP, to provide device/service description, actions, data transfer and eventing. Device search requests and advertisements are supported by running HTTP on top of UDP using multicast. Responses to search requests are also sent over UDP, but are instead sent using unicast. UPnP uses UDP due to its lower overhead, as it does not require confirmation of received data and retransmission of corrupt packets. HTTPU and HTTPMU specifications were initially submitted as an Internet Draft, but it expired in 2001; These specifications have since been integrated into the actual UPnP specifications.UPnP uses UDP port 1900, and all used TCP ports are derived from the SSDP alive and response messages.
Addressing
The foundation for UPnP networking is IP addressing. Each device must implement a DHCP client and search for a DHCP server when the device is first connected to the network. If no DHCP server is available, the device must assign itself an address. The process by which a UPnP device assigns itself an address is known within the UPnP Device Architecture as AutoIP. In UPnP Device Architecture Version 1.0, AutoIP is defined within the specification itself; in UPnP Device Architecture Version 1.1, AutoIP references IETF. If during the DHCP transaction, the device obtains a domain name, for example, through a DNS server or via DNS forwarding, the device should use that name in subsequent network operations; otherwise, the device should use its IP address.Discovery
Once a device has established an IP address, the next step in UPnP networking is discovery. The UPnP discovery protocol is known as the Simple Service Discovery Protocol. When a device is added to the network, SSDP allows that device to advertise its services to control points on the network. This is achieved by sending SSDP alive messages. When a control point is added to the network, SSDP enables that control point to actively search for devices of interest on the network or listen passively to SSDP alive messages from devices. The fundamental exchange is a discovery message containing a few essential details about the device or one of its services, such as its type, identifier, and a pointer to more detailed information.Description
After a control point has discovered a device, it still knows very little about the device. For the control point to learn more about the device and its capabilities, or to interact with the device, it must retrieve the device's description from the location provided by the device in the discovery message. The UPnP Device Description is expressed in XML. It includes vendor-specific manufacturer information like the model name and number, serial number, manufacturer name, URLs to vendor-specific websites, etc. The description also includes a list of any embedded services. For each service, the Device Description document lists the URLs for control, eventing and service description. Each service description includes a list of the commands, or actions, to which the service responds, and parameters, or arguments, for each action; the description for a service also includes a list of variables; these variables model the state of the service at run time and are described in terms of their data type, range, and event characteristics.Control
Having retrieved a description of the device, the control point can send actions to a device's service. To do this, a control point sends a suitable control message to the control URL for the service. Control messages are also expressed in XML using the Simple Object Access Protocol. Much like function calls, the service returns any action-specific values in response to the control message. The effects of the action, if any, are modeled by changes in the variables that describe the run-time state of the service.Event notification
Another capability of UPnP networking is event notification, or eventing. The event notification protocol defined in the UPnP Device Architecture is known as General Event Notification Architecture. A UPnP description for a service includes a list of actions the service responds to and a list of variables that model the state of the service at runtime. The service publishes updates when these variables change, and a control point may subscribe to receive this information. The service publishes updates by sending event messages. Event messages contain the names of one or more state variables and their current values. These messages are also expressed in XML. A special initial event message is sent when a control point first subscribes; this event message contains the names and values for all evented variables and allows the subscriber to initialize its model of the state of the service. To support scenarios with multiple control points, eventing is designed to keep all control points equally informed about the effects of any action. Therefore, all subscribers are sent all event messages, subscribers receive event messages for all "evented" variables that have changed, and event messages are sent no matter why the state variable changed.Presentation
The final step in UPnP networking is presentation. If a device has a URL for presentation, then the control point can retrieve a page from this URL, load the page into a web browser, and, depending on the capabilities of the page, allow a user to control the device and/or view device status. The degree to which each of these can be accomplished depends on the specific capabilities of the presentation page and device.AV standards
UPnP AV architecture is an audio and video extension of the UPnP, supporting a variety of devices such as TVs, VCRs, CD/DVD players/jukeboxes, set-top boxes, stereos systems, MP3 players, still image cameras, camcorders, electronic picture frames, and personal computers. The UPnP AV architecture enables devices to support various formats for entertainment content, including MPEG2, MPEG4, JPEG, MP3, Windows Media Audio, bitmaps, and NTSC, PAL, or ATSC formats. Multiple types of transfer protocols are supported, including IEEE 1394, HTTP, RTP and TCP/IP.On 12 July 2006, the UPnP Forum announced the release of version 2 of the UPnP Audio and Video specifications, together with MediaServer version 2.0 and MediaRenderer version 2.0 classes. These enhancements are created by adding capabilities to the MediaServer and MediaRenderer device classes, enabling a higher level of interoperability between products from different manufacturers. Some of the early devices complying with these standards were marketed by Philips under the Streamium brand name.
Since 2006, versions 3 and 4 of the UPnP audio and video device control protocols have been published. In March 2013, an updated UPnP AV architecture specification was published, incorporating the updated device control protocols. UPnP Device Architecture 2.0 was released in April 2020.
The UPnP AV standards have been referenced in specifications published by other organizations including Digital Living Network Alliance Networked Device Interoperability Guidelines, International Electrotechnical Commission IEC 62481-1, and Cable Television Laboratories OpenCable Home Networking Protocol.