UPnP protocol learning notes-Overview

Source: Internet
Author: User


UPnP protocol learning notes-Overview [What is UPnP technology ?] The UPnP (Universal Plug and Play) technology is an architecture designed to connect Smart appliances, wireless devices, and various types of personal computers over P2P networks. It is designed to be an easy-to-use, flexible, and standard-based connection to families, small businesses, and public places connected to ad-hoc or unmanaged networks. UPnP is a Distributed Open Network Architecture Based on TCP/IP and network technologies. It not only provides control and data transmission between network devices, but also provides seamless network connections. Www.2cto.com
The UPnP Device architecture (UDA) is not just a simple extension of the plug-and-play peripheral device model, it is designed to provide Zero Configuration, "invisible" network connection, and automatic discovery for different device types of many vendors. This means that the device can automatically join the network, obtain the IP address, broadcast its capabilities, and learn the existence and capabilities of other devices. Finally, the device can automatically leave the network without any unexpected impact.
The UPnP architecture makes full use of network protocols including IP, TCP, UDP, HTTP, XML, and so on. Similar to the Internet, the UPnP protocol is expressed in XML based on the expressive online protocol, and transmission over HTTP. With its proven capabilities, ipprotocol becomes a powerful choice for the UPnP Device architecture. These capabilities include: it spans different physical media, supports multi-vendor interaction, supports the internet, and supports collaboration between numerous home and enterprise intranets. The UPnP architecture is clearly designed to adapt to these different environments. Further, through bridging, UDA is also suitable for running non-IP protocols, these media are often unable to run the IP Protocol due to cost, technology, or system issues. Www.2cto.com
The "Universal" in UPnP is mainly reflected in: 1) the general protocol is used instead of the device driver; 2) the UPnP network is media-independent; 3) the UPnP Device can be implemented in any programming language on any operating system; 4) The UPnP architecture does not specify or restrict the design of APIs used by applications; 5) operating system vendors can create API [UPnP protocol stack] to meet their customers' needs]
The UPnP Architecture defines two types of devices: controlled devices and control points ). The control device plays the role of the server and responds to the request from the control point. Control Points and control devices can be implemented on various platforms, including PCs and embedded devices. Multiple control devices and control points can be simultaneously operated on the same network terminal. IP address (www.2cto.com 1) IP address (IP address Addressing) the foundation of UPnP network interconnection is IP address. In an IPv4 environment, each control device or control point must have a DHCP (Dynamic Host Configuration Protocol) client, find the DHCP server when you connect to the network for the first time. If a DHCP server exists in the network, such as a hosted network, the control device or control point must use the IP address assigned by the DHCP server; if the DHCP server is unavailable, such as an unmanaged network, the control device or control point must use Auto IP to obtain the IP address. To put it simply, Auto IP defines the control device or control point. If you intelligently select an IP address from the reserved IP address set, and smoothly move it in a hosted or unmanaged network. If the control device or control point can obtain the domain name through the DNS server or DNS forwarding in a DHCP transaction, the control device or control point should use this domain name in subsequent network operations; otherwise, the control device or control point should directly use the IP address.
Some UPnP networks require more complex configurations to adapt to multiple non-overlapping addressing schemes, such as multiple physical networks and multiple logical networks. The control device or control point may have two or more network interfaces, and each network interface may have two or more IP addresses. In this configuration, because different logical networks exist in the same UPnP network, a single control device or control point may be allocated to multiple IP addresses, this causes the control point to repeatedly search for the same control device. In the same UPnP network, control devices or control points with multiple IP addresses are called multi-homed ). Www.2cto.com 2) after obtaining an IP address in the (discovery) UPnP network, the next step is to find the IP address. However, when the control device is added to the network, the UPnP Discovery Protocol allows the control device to advertise the services it provides to the control point in the network. Similarly, when the control point is added to the network, the UPnP Detection protocol allows the control point to search for control devices of interest in the network. In the above two cases, the basic information exchanged between the device and the control point is a "discover message", which contains some basic information about a service provided by the device or the device, for example, type, identifier, and pointer to detailed information. 3) description after the control point discovers the control device, the control point still knows little about the control device. To learn more about the control device and its capabilities, and interact with the control device, the control point needs to obtain the description of the URL pointed to by the control device in the "discover message. The control device may contain other logical control devices, functional units, and services. The UPnP Device description is based on the XML language and contains manufacturer-related manufacturing information, such as model name and number, serial number, manufacturer name, and URL link of manufacturer-related URLs. The description also includes a list of any embedded devices or services, URLs for control, event triggering, and display. For each service, the "Description" includes a list of commands, service response actions, and parameters for each action. The service description also contains a column of variables that model the status of the Service at runtime and describe it through data types, ranges, and event features. 4) after obtaining the description of the control device from the control point www.2cto.com, the control point can send actions to the service of the device. This is achieved by sending the correct "Control Message" to the control URL of the service (provided in the device description. The control message is also expressed based on the XML Protocol and transmitted using the Simple Object Access Protocol. Similar to a function call, the service returns a response message to an action. You can describe the effect of an action by describing the variable of the Service running status. 5) the event trigger (eventing) UPnP service description contains a list of service response actions and a list of variables displayed in the service runtime status. When these variables change, the service will publish updates. The control point can subscribe to and receive these messages. The Service publishes updates by sending event messages. The event message contains the names of one or more state variables and the current values of these variables. Event messages are also expressed in XML. When the control point is subscribed for the first time, a special initialization event message is sent. The message contains the names and values of all event variables and allows the subscriber to initialize the service status mode. To support multiple control points, event triggering is designed to notify all control points of the effects of any action. Therefore, all subscribers receive all event messages. The subscriber receives an event message for all event variables that have changed. This event message is sent regardless of the status variable if it has changed (because it responds to an action or because of service model status changes ). 6) representation (www.2cto.com) If the control device provides a URL for display, the control point can display the page content in the browser through the URL, and according to the page capabilities, allows you to control devices and view device status. The degree to which each item is completed depends on the display page and the specific capabilities of the device. [Abbreviations] [terminology] 1) action: The command interface exposed by service. action has one or more input and output parameters and can return values. 2) argument: parameter of action, it can be an input or output parameter. 3) control point: used to obtain the description of device and service, send actions to services, pull status variables from service, and receive events from services. 4) device: a logical device. As a container, it can be nested with other logical devices, and its own existence can be advertised to the network. 5) device description: The formal definition of the logical device, based on the XML syntax, description in UPnP template language. Description provided by the UPnP vendor. Enter information such as the vendor name, model name, model number, serial number, control, event, and displayed URL in the UPnP device template; www.2cto.com 6) device type: the standard device type is as follows: urn: schemas-upnp-org: device: the unique identifier assigned by the Working Committee of the UPnP forum. The relationship between the device type and the UPnP device template is one-to-one. The UPnP vendor can specify the additional device type, which is defined as urn: domain-name: device: the unique identifier assigned by the vendor, where domain-name is the vendor's domain name; 7) event: notification sent when the state variable exposed by service changes; 8) GENA: General EventNotification Architecture; 9) publisher: event message source, typically a device service; 10) root device: no logical device nested in any other logical device, that is, the top-level logical device; 11) service: logical Function Unit, minimum control unit. Service exposes actions and uses state variables to model the status of physical devices. 12) service description: formal definition of logical services, which is described in the UPnP template language based on XML syntax. The UPnP vendor fills in the specified information in the UPnP service template; 13) service type: standard service type: urn: schemas-upnp-org: service: the unique identifier assigned by the UPnP Forum Working Committee: the version number of the integer type. The service type and UPnP service template are one-to-one relationships. The UPnP vendor can specify additional services. The definition is as follows: urn: domain-name: service: Unique identifier assigned by the vendor: version number, specifically, domain-name is the vendor's domain name; 14) SOAP: Simple Object Access Protocol, XML-based Remote Call mechanism, which sends commands and receives return values through HTTP; www.2cto.com 15) SSDP: simple Device Discovery Protocol: uses UDP-based HTTP multicast variants to implement multicast Discovery and search. 16) state variable: a section of the physical service model exposed by the service, state variable has a name, data type, optional default value, and optional constant value. When its value changes, an event can be triggered. 17) subscriber: the receiver of the event message, typical is a control point; 18) UPnP Dev Ice Template: A device Template that includes the device type, embedded devices, and services. Based on the XML syntax and inherited from the UPnP Device mode, which is defined by the UPnP Forum Working Committee and has a one-to-one relationship with the standard device type. 19) UPnP Service Template: Service Template, contains the action name, required parameters, statevariables, and the state variable attributes. Based on the XML syntax and inherited from the UPnP Device mode, which is defined by the UPnP Forum Working Committee. There is a one-to-one relationship with the standard Service type; www.2cto.com 20) UPnP Device Schema: defines the elements and attributes used in the UPnP Device and Service Template based on the XML syntax and inherits the XML Schema, defined by UPnP Device architecture; 21) Vendor Domain Name: The Domain Name provided by the Vendor, owned by the Vendor, and must be registered at an ICANN-certified Registrar to ensure uniqueness. The manufacturer must ensure that the registered domain name is updated immediately. The length of the Domain Name of the manufacturer must be compatible with the domain name used in UDA.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.