31
uPNP and DLNA

uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Embed Size (px)

Citation preview

Page 1: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

uPNP and DLNA

Page 2: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

uPNP Device Architecture

• defines an architecture for pervasive peer-to-peer network connectivity of intelligent appliances, wireless devices, and PCs of all form factors

• easy-to-use, flexible, standards-based connectivity to ad-hoc or unmanaged networks

• Specifications

– UPnP Device Architecture ( formerly known as DCP Framework )

– zero-configuration

– "invisible" networking

– automatic discovery for a breadth of device categories

• Basis

– Internet protocols such as IP, TCP, UDP, HTTP, and XML.

Page 3: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

uPNP Protocol Stack

• ALL MESSAGES are based on the HTTP protocol

• SSDP : Simple Service Discovery Protocol

• GENA : General Event Notification Architecture

• uPNP is based on IP protocols.

• UPnP general device classification

– Controlled devices ( or devices ) : server

– Control Points

• Glossary– Device : logical device.

– Service : logical functional unit. Smallest units of control. (action/ variables)

Page 4: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

UPnP Steps

0. Addressing

– DHCP, static IP assignment or AUTO IP.

1. Discovery

– Discovery message format, including URL for description.

– How devices advertise.

– How control points search devices.

2. Description

– Expressed in XML, and can be accessed via HTML using URL.

– Includes device information

– Includes URL for control, eventing and presentation.

– Includes variables to model the state of the service at runtime.

3. Control

– Expressed in XML using SOAP.

– Returns any action-specific values.

– May change the variables.

Page 5: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

UPnP Steps

4. Eventing

– Subscription and Update

• Update : by service if variable changes.

• Subscription : by control point to the service.

– Multicast Eventing

• when events which are not relevant to specific UPnP interactions should be delivered to control points to inform users.

• when multiple controlled devices want to inform multiple other control points

• Retransmission.

5. Presentation

– Presentation to User using a Browser.

– URL for presentation is in Description message

– User may access to that URL with a browser and control the device or view device status.

Page 6: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Step0 : Addressing

• All DHCP-compatible device should have IP address.

– UPnP and DLNA is based on IPv4

– IPv6 compatibility is written in annex of UDA

• Addressing

– Should support DHCP.

– Auto-IP : 169.254/16 address range. Link-local address (RFC3927)

– May use static IP address.

Page 7: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Step 1 : DISCOVERY

Page 8: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Step 1 : DISCOVERY

• UPnP Discovery Protocol

– Based on SSDP protocol

– Control point : search for devices

– Device : advertise its service to control points

• Device (server)

– MUST Multicast discovery messages when added to the network.

– Standard multicast address in SSDP : 239.255.255.250

• Control Point (client)

– MAY Multicast discovery messages when added to the network.

– Standard port for SSDP : 1900

• Bonjour, ZeroConfig, SSDP…?

– http://www.zeroconf.org/ZeroconfAndUPnP.html

– http://en.wikipedia.org/wiki/Zeroconf#Service_discovery

Page 9: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Step 1 : DISCOVERY

• SSDP Message Format

– SSDP is in the HTTTP header field.

• SSDP Start-line

• SSDP message header fields

• SSDP header field extensions

• UUID

– DCE variant of Universal Unique Identifiers (UUIDs), The Open group, 1997, Available at: http://www.opengroup.org/onlinepubs/9629399/apdxa.htm.

Page 10: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Step 1 - Advertisement

• NT : Notification Type

– upnp:rootdevice

– uuid:device-UUID

– urn:schemas-upnp-org:device:deviceType:ver

– urn:schemas-upnp-org:service:serviceType:ver

– urn:domain-name:device:deviceType:ver

– urn:domain-name:service:serviceType:ver

• NTS : ssdp:alive

• CACHE-COBTROL : should be greater than 1800.

• USN : Unique Service Name.– uuid:device-UUID::upnp:rootdevice

– uuid:device-UUID

– …etc.

Page 11: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Step 1 - Advertisement

Page 12: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Step 1 - Advertisement

• Device unavailable -- NOTIFY with ssdp:byebye

• Device Update – NOTIFY with ssdp:update

Page 13: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Step 1 - Search

• Search Request : M-SEARCH

• Search Response

Page 14: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Step 2 : Description

• Description : Information about device and service

• Device Description : for physical and logical containers

– Vendor-specific information.

– Service type

– Service name

– URLs (service description, control and eventing for each service)

– URS for presentation (of the aggregate)

• Service Description

– Actions and arguments

– To control a service (action) and get a response (argument)

Page 15: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Device Description

Page 16: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Service Description

scpd : service control protocol description

Page 17: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

HTTP

Page 18: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Step 3 : Control

• Based on SOAP protocol.

Page 19: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

SOAP 1.1 UPnP Profile

Page 20: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

HTTP

Retrieved by description

Page 21: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

HTTP

Page 22: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Step 4 : Eventing

• Unicast Eventing

– Subscription model

– Control Point subscribes to a variable of a service.

– Service sends an event when variable changes.

• Multicast Eventing

– Service multicasts an event when variable changes to multicast group.

• Publisher-Subscriber-Receiver

– Publisher : service (source of events)

– Subscriber : control point (destination of events)

– Receiver : control point or controlled device, listener of multicast device

Page 23: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Step 4 : Eventing

Page 24: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Step 4 : Eventing

• Subscriber information Publisher

– Unique subscription identifier

– Delivery URL for event messages

– Event key

– Subscription duration

– HTTP version of subscriber

• Subscriber

– Sends subscription message to a service

• URL for the publisher, service id for the publisher and delivery URL for event messages.

• MAY include duration.

– Subscription : to a Service.

• All the variables of a service will be used for eventing.

• No individual subscription of a variable of a service.

Page 25: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Unicast Eventing

• Publisher

– Send respond to the subscriber : Unique ID and duration

• Initial event message

– ASAP after the subscription is accepted.

– Names and current value of all evented variables.

• Subscription Renewal

– By subscriber

– No delivery URL in its message

Page 26: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Unicast Eventing

Page 27: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Unicast Eventing

Page 28: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Multicast Eventing

• A HTTP-like message : since it is sent via UDP

• On a ONE single UDP payload :

– If big, several UDP message can be sent.

– fragmentation is done by UPnP, not by UDP.

• Can be retransmitted as defined by UPnP

Page 29: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Unicast Event : HTTP

Page 30: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Multicast Event : HTTP

Page 31: uPNP and DLNA - Egloospds14.egloos.com/pds/200907/11/09/uPNP_and_DLNA.pdf · uPNP Device Architecture •defines an architecture for pervasive peer-to-peer network connectivity of

Step 5 : Presentation